What is INSTALL_PARSE_FAILED_NO_CERTIFICATES error

2019-01-04 08:34发布

I was trying to change my default/main/startup (whatever you call it) activity by editing the androidmanifest.xml file. All i did was change the android:name property. however, this completely broke the entire app. when I try to install it fails and reads.

Installation error: INSTALL_PARSE_FAILED_NO_CERTIFICATES

When I tried to change it back to its previous state, it was still giving me the same error... What have I done?

16条回答
霸刀☆藐视天下
2楼-- · 2019-01-04 09:13

This is an ugly but fast solution: use JDK 6 instead of 7.

After read Chloe's answer, I uninstalled my JDK 7 (don't need it currently anyways) and installed JDK 6. That fixed it. A better solution would make ant uses JDK 6 (without uninstalling 7). Maybe possible changing / setting this property:

java.library.path

in local.properties file. It's in the project directory (root).

Android doesn't work with JDK 7 anyways (only 6 or 5), so make that the ant script also uses JDK 6 or 5 is probably a good solution.

查看更多
\"骚年 ilove
3楼-- · 2019-01-04 09:14

In my case, I could build and run release builds, but got the INSTALL_PARSE_FAILED_NO_CERTIFICATES error when trying to do a debug build.

The solution was to delete my debug.keystore file and let ADT recreate it. It had apparently expired.

A better long-term solution is to explicitly create a debug.keystore that does not expire after only a year, instead of letting ADT create it. Here is the command to do that:

keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -validity 14000

When prompted, enter these values:

  • First and last name: Android Debug
  • Organizational unit: Android
  • Name of organization: Unknown
  • City or Locality: Unknown
  • State or Province: Unknown
  • Country code: US
查看更多
爷的心禁止访问
4楼-- · 2019-01-04 09:14

In newer Android Studio versions 3.2+, if you are trying to run release install, and you have not defined any signing configurations, it will show the error prompt and install will fail. What you need to do is either run the debug build or set up the signing configuration (V1 or V2) correctly.

查看更多
放我归山
5楼-- · 2019-01-04 09:15

solved (for me) using in keytool the args

-sigalg MD5withRSA -keyalg RSA -keysize 1024

and using in jarsigner

-sigalg MD5withRSA -digestalg SHA1

solution found in

What kind of pitfals exist for the Android APK signing?

查看更多
淡お忘
6楼-- · 2019-01-04 09:19

I found that this error can now also occur when using the wrong signing config. As described here, Android 7.0 introduces a new signature scheme, V2. The V2 scheme signs the entire APK rather than just the JAR, as is done in the V1 scheme. If you sign with only V2, and attempt to install on a pre-7.0 target, you'll get this error since the JARs themselves are not signed and the pre-7.0 PackageManager cannot detect the presence of the V2 APK signature.

To be compatible with all target systems, make sure the APK is signed with both schemes by checking both signature version boxes in Android Studio's Generate Signed APK dialog as shown here:

enter image description here

If only 7.0 targets are anticipated, then there is no need to include the V1 signature.

查看更多
老娘就宠你
7楼-- · 2019-01-04 09:19

I was having this error in my Eclipse Console. It turns out that I had two jars with the same content but different names and they were conflicting with each other. I just deleted one of them and managed to install the app on the device.

查看更多
登录 后发表回答