简体   繁体   中英

Failed to install android APK

I was trying to build an debug APK using Android Studio to test on my mobile device. But this problem occurs. Here the error log that I was able to retrieve.

11-19 16:52:23.096: W/PackageManager(1628): Failed collect during installPackageLI
11-19 16:52:23.096: W/PackageManager(1628): android.content.pm.PackageParser$PackageParserException: Package /data/app/vmdl322169606.tmp/base.apk has no certificates at entry AndroidManifest.xml
11-19 16:52:23.096: W/PackageManager(1628):     at android.content.pm.PackageParser.collectCertificates(PackageParser.java:1099)
11-19 16:52:23.096: W/PackageManager(1628):     at android.content.pm.PackageParser.collectCertificates(PackageParser.java:1049)
11-19 16:52:23.096: W/PackageManager(1628):     at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:10804)
11-19 16:52:23.096: W/PackageManager(1628):     at com.android.server.pm.PackageManagerService.access$2300(PackageManagerService.java:236)
11-19 16:52:23.096: W/PackageManager(1628):     at com.android.server.pm.PackageManagerService$6.run(PackageManagerService.java:8858)
11-19 16:52:23.096: W/PackageManager(1628):     at android.os.Handler.handleCallback(Handler.java:739)
11-19 16:52:23.096: W/PackageManager(1628):     at android.os.Handler.dispatchMessage(Handler.java:95)
11-19 16:52:23.096: W/PackageManager(1628):     at android.os.Looper.loop(Looper.java:135)
11-19 16:52:23.096: W/PackageManager(1628):     at android.os.HandlerThread.run(HandlerThread.java:61)
11-19 16:52:23.096: W/PackageManager(1628):     at com.android.server.ServiceThread.run(ServiceThread.java:46)

Try to signed your APK. If you already installed a copy previously, try to uninstall it and install again.

 writing AndroidManifest.xml file  

 android:usesCleartextTraffic="true"

               or

 Open File> Click on Invalidate Caches/Restart

              or

Try to signed your APK with version 1. Version 2 signed APK only compatible from 7.0 so it will not working on below 7.0 devices or try to generate v1 and v2 version APK.

Note: When you generate signed apk for above 7.0 devices and below 7.0 devices then please check v1 and v2 both option.

Here is the reference link for more about V2 version and here is the link for overview.

Try this out and Your issue will resolved.

It shows error that you don't have a certificate connected with your.APK file. Usually android gives debug certificate that is verified by android devices before installation.Do Invalidate cache and Restart.If error still persist then their you may have added any file which either does not have any extension or you have altered its Extension.I had same issue and this resolved my problem.Hope it wokrs for you:).

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