INSTALL_PARSE_FAILED_NO_CERTIFICATES, and the relation between android api level, gradle jvm, project sdk, and gradle version?
I see a pattern like, higher the version of gradle jvm(Settings -> Build Tool -> Gradle -> Gradle JVM), project sdk(File -> Project Structure -> Projects -> SDK), and gradle version(gradle/wrapper/gradle-wrapper.properties -> distributionUrl), more the error I am getting in lower android api level, while installing as debug mode. The error is,
> INSTALL_PARSE_FAILED_NO_CERTIFICATES
I am trying to install on android 10, api 29.
The installation does`nt give error while installing on api 35, on emulator.
gradle jvm = Eclipse Temurin 23.0.2
project sdk = jbr-21 (JetBrains Runtime 21.0.10)
gradle version = gradle-8.13-bin.zip
The application has minSdk = 28, and compileSdk = 36.
So, why it is giving the error for lower android? And what is the solution for developing app for lower api level devices?
Edit:
Below is the example of newly created project or apk, the apk is not installed on the device before.
Below is the command and output of apksigner:
# /home/USER/Android/Sdk/build-tools/36.1.0/apksigner verify --print-certs -v app-debug.apk
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by org.conscrypt.NativeLibraryUtil in an unnamed module (file:/home/USER/Android/Sdk/build-tools/36.1.0/lib/apksigner.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
Verifies
Verified using v1 scheme (JAR signing): false
Verified using v2 scheme (APK Signature Scheme v2): true
Verified using v3 scheme (APK Signature Scheme v3): false
Verified using v3.1 scheme (APK Signature Scheme v3.1): false
Verified using v4 scheme (APK Signature Scheme v4): false
Verified for SourceStamp: false
Number of signers: 1
Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
Signer #1 certificate SHA-256 digest: 33745668762351c50725698551ee8bb9690428060c4ecc45b4ec49bfe871b7ce
Signer #1 certificate SHA-1 digest: 7d9548b267d7ab7cb8cdcc6f1ed30f456203d266
Signer #1 certificate MD5 digest: b6ad7139b6e2e9efa7605b9e75758656
Signer #1 key algorithm: RSA
Signer #1 key size (bits): 2048
Signer #1 public key SHA-256 digest: 3167ebe08fb93f9f2b223c41b79abf5c700bc6a104718b6f9335f48bd33ef90b
Signer #1 public key SHA-1 digest: 73029037835e757e16c27c3fb71613e6014a8408
Signer #1 public key MD5 digest: 40117949b7e2ab977b54dd55ef9aca9c
And while installing with adb:
# adb install app-debug.apk
Performing Streamed Install
adb: failed to install app-debug.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl1581536238.tmp/base.apk using APK Signature Scheme v2: SHA-256 digest of contents did not verify]