alibaba / freeline

A super fast build tool for Android, an alternative to Instant Run
https://www.freelinebuild.com/
BSD 3-Clause "New" or "Revised" License
5.48k stars 623 forks source link

gradlew initFreeline -Pmirror 失败 #968

Open fishforest opened 6 years ago

fishforest commented 6 years ago

版本:classpath 'com.antfortune.freeline:gradle:0.8.8' 在windows上操作,本地gradle版本:4.1 执行 gradlew initFreeline -Pmirror 一直失败,日志如下: image

act262 commented 6 years ago

gradle plugin 3.0.0+ 需要配置google()仓库

fishforest commented 6 years ago

@act262 感谢!配置google()后就可以正常下载了。不过在第一次全量编译(python freeline.py -f -d )的时候,没编译成功。freeline使用git上最新版本,android系统5.1.1。 日志如下: FAILURE: Build failed with an exception.

工程配置: image image

act262 commented 6 years ago

当前gradle plugin还需要先禁用aapt2

fishforest commented 6 years ago

@act262 再次感谢!第一次全量编译已经成功。为了体验增量编译,尝试修改了xxx.java文件,然后执行:python freeline.py -d,很快就编译报错。错误如下: [DEBUG] [dispatcher] Android Gradle Plugin Version: 3.0.1 [DEBUG] [dispatcher] Freeline Gradle Plugin Version: 0.8.8 [DEBUG] [dispatcher] *** Freeline Python Version: v0.8.8 [DEBUG] [scan_changed_files_command] find D:\project\Robot\Android\src\as\release\didano-robot\app\src\main\java\com\didano\robot\module\morningcheck\MorningCheckThread.java has modification. [DEBUG] [scan_changed_files_command] find D:\project\Robot\Android\src\as\release\didano-robot\app\src\main\java\com\didano\robot\module\morningcheck\MorningCheckThread.java has modification. [DEBUG] find app has 1 java files modified. [DEBUG] project just need a incremental build. [DEBUG] file changed list: { "build_info": { "last_clean_build_time": 1521447979.536, "is_root_config_changed": false }, "projects": { "app": { "src": [ "D:\project\Robot\Android\src\as\release\didano-robot\app\src\main\java\com\didano\robot\module\morningcheck\MorningCheckThread.java" ], "so": [], "assets": [], "libs": [], "res": [], "config": [], "cpp": [], "manifest": [] } } }

[ERROR] Freeline ERROR [ERROR] -------------------------------------------------------- -Djava.ext.dirs=C:\Users\xiaoyuren\AppData\Local\Android\sdk\build-tools\27.0.3\lib is not supported. Use -classpath instead.

Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

[ERROR] -------------------------------------------------------- [ERROR] incremental dex compile failed. [ERROR] -------------------------------------------------------- [DEBUG] Prepare tasks time: 0.2s [DEBUG] Task engine running time: 2.9s [DEBUG] Total time: 3.1s

查看了历史issues,也有增量失败的例子,不过没有有效解决。修改的xxx.java具体来说只是增加了1行打印,请问会是“-Djava.ext.dirs=C:\Users\xiaoyuren\AppData\Local\Android\sdk\build-tools\27.0.3\lib is not supported. Use -classpath instead.” 的原因吗?