3、输入gradle check执行(检查项目,根据渠道数量不同需要时间不同)
4、输入gradle build执行(执行build脚本,开始打包,根据渠道数量不同需要时间不同,45个渠道大概需要1个多小时)
5、检查主项目build.gradle配置的输出目录中,打好的渠道包已经在里面了
六、注意事项(待续)
Q1:在执行check或者build时,可能会报如下错误
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':lint'.
> Lint found errors in the project; aborting build.
Fix the issues identified by lint, or add the following to your build script to proceed with errors:
...
android {
lintOptions {
abortOnError false
}
}
...
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
A1:在build.gradle脚本中增加
lintOptions {
abortOnError false
}
Q2:根据渠道数量的多少,可能在打包时会报java虚拟机内存不足
The system is out of resources. Consult the following stack trace for details. java.lang.OutOfMemoryError: Java heap space at com.sun.tools.javac.util.Position$LineMapImpl.build(Position.java:139) at com.sun.tools.javac.util.Position.makeLineMap(Position.java:63) at com.sun.tools.javadoc.DocCommentScanner.getLineMap(DocCommentScanner.java:438) at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:512) at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:550) at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:804) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727) at com.sun.tools.javac.main.Main.compile(Main.java:353) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:115)
以上所述是小编给大家分享的Android客户端程序Gradle如何打包的相关知识,希望对大家有所帮助。
注:相关教程知识阅读请移步到Android开发频道。










