执行:
./gradlew initFreeline -Pmirror
报错
FAILURE: Build failed with an exception.
* Where:
Build file '省略号/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[ERROR] --------------------------------------------------------
[ERROR] freeline failed when read project info with script: ./gradlew -q checkBeforeCleanBuild
[ERROR] --------------------------------------------------------
[DEBUG] Prepare tasks time: 0.2s
[DEBUG] Task engine running time: 2.1s
[DEBUG] Total time: 2.3s
[DEBUG] --------------------------------------------------------
然后各种猜测,各种不对。。。
最后在android studio 的命令行输入:java -version,发现是java版本是1.7。迅速改成1.8,修改方法:
https://jingyan.baidu.com/article/d2b1d1029c1ea65c7e37d4c9.html
记着,在android studio的命令行中输入:
source ~/.bash_profile
使其生效。在freeline命令行中同样要执行本句。
然后重新执行:
./gradlew initFreeline -Pmirror
一路畅通,最终看到
BUILD SUCCESSFUL
Total time: 20.945 secs
------------------------------------------------------------------------------------------------------
然后在执行 freeline,继续出现问题:
What went wrong:
Execution failed for task ':app:mergeLocalDebugAssets'.
> 省略号/app/build/intermediates/assets/debug/apktime file not found.
Missing the `productFlavor` configuration?
You can try to add `productFlavor` to freeline DSL, for example:
freeline {
hack true
productFlavor 'your-flavor'
}
Then re-run `python freeline.py` again.
http://blog.csdn.net/yk377657321/article/details/53694306
好了