简体   繁体   中英

Android APP Bundles apks can not installed by bundletool(INSTALL_PARSE_FAILED_NO_CERTIFICATES)

I buile my application through Android APP Bundles and I get an apks file through

bundletools:<br>
.\bundletool-all-0.11.0.jar build-apks --bundle=gallery-v1.2.1_8-googleplay-release.aab --output=gallery-gp.apks<br>
But when I want to install the apks into devices by this commond:<br>
java -jar .\bundletool-all-0.11.0.jar install-apks --apks=gallery-gp.apks I get those errors:<br>

WARNING: An illegal reflective access operation has occurred<br>
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/E:/temp/apk/bundletool-all-0.11.0.jar) to field java.nio.Buffer.address     <br>
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil<br>
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations<br>
WARNING: All illegal access operations will be denied in a future release<br>
The APKs have been extracted in the directory: C:\Users\CHRISZ~1\AppData\Local\Temp\10477684387867783528
01:12:24 E/SplitApkInstaller: Failed to finalize session : INSTALL_PARSE_FAILED_NO_CERTIFICATES: Package /data/app/vmdl1694662475.tmp/0_base-xxhdpi has no certificates at entry AndroidManifest.xml<br>
[BT:0.11.0] Error: Installation of the app failed.<br>
com.android.tools.build.bundletool.model.exceptions.InstallationException: Installation of the app failed.<br>
        at com.android.tools.build.bundletool.model.exceptions.InstallationException$Builder.build(InstallationException.java:47)
        at com.android.tools.build.bundletool.model.exceptions.InstallationException$Builder.build(InstallationException.java:41)
        at com.android.tools.build.bundletool.device.DdmlibDevice.installApks(DdmlibDevice.java:133)
        at com.android.tools.build.bundletool.device.ApksInstaller.installOnDevice(ApksInstaller.java:94)
        at com.android.tools.build.bundletool.device.ApksInstaller.installApks(ApksInstaller.java:82)
        at com.android.tools.build.bundletool.device.ApksInstaller.installApks(ApksInstaller.java:44)
        at com.android.tools.build.bundletool.commands.InstallApksCommand.execute(InstallApksCommand.java:165)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:88)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:46)
Caused by: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_PARSE_FAILED_NO_CERTIFICATES: Package /data/app/vmdl1694662475.tmp/0_base-xxhdpi has no certificates at entry AndroidManifest.xml
        at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:91)
        at com.android.ddmlib.Device.installPackages(Device.java:928)
        at com.android.tools.build.bundletool.device.DdmlibDevice.installApks(DdmlibDevice.java:117)
        ... 6 more<br>

I think I realy have signed my app bucause I use ./gradlew assembleRelease can get an normal apk and it can be installed into device success, but I use ./gradlew bundleRelease get an aab and it can not be installed into device with error INSTALL_PARSE_FAILED_NO_CERTIFICATES.
Any suggestion will be appreciated.

The problem has been solved. After further checking the documentation, I learned that when using bundletool to generate an APK set archive, a signature file needs to be specified. The reason why I did not specify it before, but the generated apks can still be installed because bundletool will use the debug signature as default, and when I generate this file, the debug signature on my machine is lost for some reason, so the generated file cannot be installed due to the missing signature. After I regenerate the debug signature file on my machine, the apks generated again can be installed. Thanks for the help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM