INSTALL_PARSE_FAILED_NO_CERTIFICATES 오류는 무엇입니까?
androidmanifest.xml
파일 을 편집하여 기본 / 기본 / 시작 (당신이 무엇이든간에) 활동을 변경하려고했습니다 . 내가 한 것은 android:name
재산 을 바꾸는 것이었다 . 그러나 이것은 전체 앱을 완전히 파괴했습니다. 설치하려고하면 실패하고 읽습니다.
설치 오류 : INSTALL_PARSE_FAILED_NO_CERTIFICATES
이전 상태로 되돌리려 고했지만 여전히 같은 오류가 발생했습니다. 어떻게해야합니까?
파일 에서 AndroidManifest.xml
직접 편집 했습니까 .apk
? 그렇다면 작동하지 않습니다.
.apk
마켓을 통해 설치하지 않더라도 휴대 전화에 설치하려는 경우 모든 Android에 서명해야합니다 . 개발 도구는 개발 인증서로 서명하여이 문제를 해결하지만 .apk
여전히 서명되어 있습니다.
이를 사용 .apk
하면 인증서가 동일 하므로 장치가 설치된 응용 프로그램의 유효한 업그레이드 인지 알 수 있습니다 .
따라서 앱을 전혀 변경 .apk
하지 않으면 제대로 서명되도록 앱을 다시 빌드해야합니다 .
잘못된 서명 구성을 사용할 때이 오류가 발생할 수도 있음을 알았습니다. 여기 에 설명 된대로 Android 7.0에는 새로운 서명 체계 V2가 도입되었습니다 . V2 체계는 V1 체계에서와 같이 JAR이 아닌 전체 APK에 서명합니다. V2로만 서명하고 7.0 이전 대상에 설치하려고하면 JAR 자체가 서명되지 않고 7.0 이전 PackageManager 가 V2 APK 서명이 있는지 감지 할 수 없으므로이 오류가 발생 합니다.
모든 대상 시스템과 호환되도록 다음과 같이 Android Studio의 서명 된 APK 생성 대화 상자에서 두 서명 버전 상자를 모두 확인하여 APK가 두 구성표로 서명되어 있는지 확인 하십시오.
7.0 대상 만 예상되는 경우 V1 서명을 포함 할 필요가 없습니다.
JDK 버전으로 인한 것입니다.
'ant'와 함께이 문제가 발생했으며 설명서에 언급 된주의 때문에 발생했습니다.
http://developer.android.com/guide/publishing/app-signing.html#signapp
주의 : JDK 7부터 기본 서명 알고리즘이 변경되었으므로 APK에 서명 할 때 서명 및 다이제스트 알고리즘 (-sigalg 및 -digestalg)을 지정해야합니다.
JDK 7이 있습니다. Ant 로그에서 상세 -v를 -v를 사용하여 표시했습니다.
$ ant -Dadb.device.arg=-d -v release install
[signjar] Executing 'C:\Program Files\Java\jdk1.7.0_03\bin\jarsigner.exe' with arguments:
[signjar] '-keystore'
[signjar] 'C:\cygwin\home\Chloe\pairfinder\release.keystore'
[signjar] '-signedjar'
[signjar] 'C:\cygwin\home\Chloe\pairfinder\bin\PairFinder-release-unaligned.apk'
[signjar] 'C:\cygwin\home\Chloe\pairfinder\bin\PairFinder-release-unsigned.apk'
[signjar] 'mykey'
[exec] pkg: /data/local/tmp/PairFinder-release.apk
[exec] Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
JAR에 수동으로 서명하고 zipaligned했지만 약간 다른 오류가 발생했습니다.
$ "$JAVA_HOME"/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore release.keystore -signedjar bin/PairFinder-release-unaligned.apk bin/PairFinder-release-unsigned.apk mykey
$ zipalign -v -f 4 bin/PairFinder-release-unaligned.apk bin/PairFinder-release.apk
$ adb -d install -r bin/PairFinder-release.apk
pkg: /data/local/tmp/PairFinder-release.apk
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
641 KB/s (52620 bytes in 0.080s)
I found that answered here.
How to deal with INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES without uninstallation
I only needed to uninstall it and then it worked!
$ adb -d uninstall com.kizbit.pairfinder
Success
$ adb -d install -r bin/PairFinder-release.apk
pkg: /data/local/tmp/PairFinder-release.apk
Success
641 KB/s (52620 bytes in 0.080s)
Now I only need modify the build.xml to use those options when signing!
Ok here it is: C:\Program Files\Java\android-sdk\tools\ant\build.xml
<signjar
sigalg="MD5withRSA"
digestalg="SHA1"
jar="${out.packaged.file}"
signedjar="${out.unaligned.file}"
keystore="${key.store}"
storepass="${key.store.password}"
alias="${key.alias}"
keypass="${key.alias.password}"
verbose="${verbose}" />
Most of the time the solution for this error is really simple:
- Uninstall your apk
- Clean your Android project
- Build your Android project
- Install / run your apk
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?
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
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.
Its because previously generated build and current is having conflict in signature version between v1(jar signature) and v2(full APK Signature),
To fix tick proper signature version under Generate Signed APK dialog
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.
I was also facing the same issue. First I generated build using V2 and installed that in mobile devices running on OS 5.1 and I got the same issue. But build was working fine on Tablet running on OS 7.0. So I generated build with V1 Jar signature and it was working fine on both the devices.
Conclusion: If you are supporting the device below android OS 7.0. Use V1 jar signature to generate the build.
This could happen if you try to include a .jar
library that contains an AndroidManifest.xml
file.
- If it's pure Java make sure you don't include it in the .jar export
- If it's not pure Java (meaning it's an Android project) then you have to include it as a Library Project
Setting environment variable JAVA_HOME
to JDK 5 or 6 (instead of JDK 7) fixed the error.
After some time and multiple online threads on the subject I managed to fix my project.
It's mainly taking into consideration the last files (could be images or layouts) that you put in. If you delete them, it will work out, and you can build your project again.
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.
I was getting this error because I did release that my ant release
was failing because I ran out of disk space.
I got this error when I tried to install a Xamarin project built against Android N preview on a phone running api v23. Solution is to not do that.
Another way to get this error is to build using ant
on macOS and have a Finder icon file (Icon\r
) in the source tree of the app. It appears jarsigner
can't cope with the carriage return in the filename and, although it will claim the signing is valid if you -verify
the APK, it always results in an APK that wont install on a device. Ironically, the Google Drive Finder plugin is a great source of Finder icon files.
The solution is to exclude the offending files (which are useless in the APK anyway) with a specifier like this in the fileset
:
<exclude name="**/Icon " />
This problem will happen if you are installing un-signed version of APK. Check if you are install correct APK.
I had that problem with ionic / Visual Studio Code (Run Android on device):
모바일 장치에서 앱을 제거했지만 (설정 / 앱) 오류가 사라지고 앱이 시작됩니다.
참고 URL : https://stackoverflow.com/questions/2914105/what-is-install-parse-failed-no-certificates-error
'development' 카테고리의 다른 글
기능 매개 변수의 유형을 설정 하시겠습니까? (0) | 2020.07.01 |
---|---|
DataTable을 반복하는 방법 (0) | 2020.07.01 |
부트 스트랩에서 탭을 비활성화 할 수 있습니까? (0) | 2020.07.01 |
FileProvider 충돌-null 문자열에서 XmlResourceParser를 호출하려고 시도합니다. (0) | 2020.07.01 |
일부 속성별로 개체 목록을 정렬하는 방법 (0) | 2020.07.01 |