Android Studio如何生成已签名的APK转换为命令行语句?
当我执行以下操作时,我会得到一个编译并签名的APK:
- 选择构建 - >生成签名的捆绑包或APK
- 选择APK
- 选择我的JKS文件,然后给出正确的密码等。
- 选择“构建变体” Release
现在我想在命令行上进行相同的操作(用于在CI管道中使用)。我可以从上面的输出中看到它是执行任务:[:app:assemblerelease]
当我打开终端和类型时,
gradlew :app:assembleRelease
我会得到错误
执行任务失败':app:compileleasejavawithjavac'。 找不到工具。请检查C:\ Program Files \ Java \ JRE1.8.0_311包含有效的JDK安装。
我无法在计算机上的任何地方找到工具。
因此,问题是:编译和签署APK时,向导执行什么?
When I do the following, I get a compiled and signed apk:
- Select Build -> Generate Signed Bundle or APK
- Select APK
- Select my jks file and give the correct passwords etc
- Select Build variant release
Now I want to do the same on the command line (for use in a CI pipeline). I can see from the above output that it is Executing tasks: [:app:assembleRelease]
When I open a terminal and type
gradlew :app:assembleRelease
I get the error
Execution failed for task ':app:compileReleaseJavaWithJavac'.
Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_311 contains a valid JDK installation.
I cannot find tools.jar anywhere on my computer.
So the question is: What exactly is the wizard executing when compiling and signing the apk?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论