如何解决安卓工作室中无效的密钥库格式


  • 出了什么问题:
    任务":app:signReleaseBundle"的执行失败

执行com.android.build.gradle.internal.tasks.Workers$ActionFacade时出错从存储"读取密钥失败/Users/klien/klien/document/key.jks":密钥存储格式无效

使用keytool可执行文件的特定版本生成密钥库似乎非常重要。在我的Windows机器上,搜索keytool.exe得到了很多结果:

c:Program FilesAndroidAndroid Studiojrebinkeytool.exe
c:Program FilesEclipse Foundationjdk-8.0.302.8-hotspotbinkeytool.exe
c:Program FilesEclipse Foundationjdk-8.0.302.8-hotspotjrebinkeytool.exe
c:Program Files (x86)Javajre1.8.0_301binkeytool.exe
c:ProgramDataSony MobileUpdate Engine{5152617D-088D-4700-97C9-A2696A37E999}jrebinkeytool.exe
c:UsersAll UsersSony MobileUpdate Engine{5152617D-088D-4700-97C9-A2696A37E999}jrebinkeytool.exe

对于我的React Native应用程序,我最初使用c:Program Files (x86)Javajre1.8.0_301binkeytool.exe创建了密钥库,假设这将是最具权威性的Java安装,但得到了"Invalid keystore format"错误。

解决方案是使用c:Program FilesAndroidAndroid Studiojrebinkeytool.exe。这背后的基本原理是使用与构建引擎相同的Java安装(在我的案例中是gradlew bundleRelease(。

(从这里复制粘贴我的答案:如何在android studio中解决无效的密钥库格式?(

最新更新