Android Question [SOLVED] No signature found in package of version 2 or newer for package

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hello

We are working with a phone manufacturer and they have supplied us with the signapk.jar, platform.x509.pem, platform.pk8 file so we can sign our app as a system app. In the manifest file of the app I have added SetManifestAttribute(android:sharedUserId, "android.uid.system").

The phone is running Android 11

I have a batch file to do the build:

B4X:
REM EX710
"C:\Program Files (x86)\Anywhere Software\Basic4android\B4ABuilder.exe" -task=Build -obfuscate=True -BaseFolder="C:\Users\John Murphy\Documents\B4A\Atlas\SOS\working" -Configuration=ex710_system -Output=atlas_sos4.apk
copy "C:\Users\John Murphy\Documents\B4A\Atlas\SOS\working\Objects\atlas_sos4.apk" "C:\Users\John Murphy\Documents\B4A\Atlas\SOS\ex710 signapk"

cd \
cd "C:\Users\John Murphy\Documents\B4A\Atlas\SOS\ex710 signapk"
java -jar signapk.jar platform.x509.pem platform.pk8 atlas_sos4.apk atlas_sos4_ex710.apk
copy "C:\Users\John Murphy\Documents\B4A\Atlas\SOS\ex710 signapk\atlas_sos4_ex710.apk" "C:\Users\John Murphy\Documents\B4A\Atlas\SOS\working\Output"

pause

The build is succuessful. I then copy the atlas_sos4_ex710.apk to the phone download folder, and using the file explorer on the phone select it to install. I am asked the usual 'Do you want to install this application?', I select install, and I get a message saying 'You can't install the app on your device'.

The target SDK in the manfest is set to 30.

The following is from the unfiltered logs for the phone. Two things to notice in the logs, #1-Malformed package, #2-No signature found in package of version 2 or newer for package com.is.vitllinkSOS

Does anyone have any ideas solutions for this.

B4X:
[156] VerifyInstallTask.d(10): VerifyApps: No APK could be parsed in multi-APK archive
[156] VerifyAppsInstallTask.ac(5): VerifyApps: Cannot read archive for file:///data/app/vmdl610927314.tmp in request id=11, package=com.is.vitllinkSOS. Malformed package?
setInputWindows displayId=0 Window{3ec0758 u0 NavigationBar0} Window{c33f3f4 u0 StatusBar} Window{c2c39f5 u0 com.google.android.apps.nbu.files/com.google.android.apps.nbu.files.documentbrowser.filebrowser.FileBrowserRegularActivity} Window{18394c6 u0 com.android.systemui.ImageWallpaper}
Unknown element under <manifest>: meta-data at /data/app/vmdl610927314.tmp/base.apk Binary XML file line #21
Unknown element under <manifest>: meta-data at /data/app/vmdl610927314.tmp/base.apk Binary XML file line #22
Unknown element under <manifest>: meta-data at /data/app/vmdl610927314.tmp/base.apk Binary XML file line #23
Unknown element under <manifest>: meta-data at /data/app/vmdl610927314.tmp/base.apk Binary XML file line #21
Unknown element under <manifest>: meta-data at /data/app/vmdl610927314.tmp/base.apk Binary XML file line #22
Unknown element under <manifest>: meta-data at /data/app/vmdl610927314.tmp/base.apk Binary XML file line #23
uid=1000(system) Binder:1150_8 identical 1 line
setInputWindows displayId=0 Window{3ec0758 u0 NavigationBar0} Window{c33f3f4 u0 StatusBar} Window{c2c39f5 u0 com.google.android.apps.nbu.files/com.google.android.apps.nbu.files.documentbrowser.filebrowser.FileBrowserRegularActivity} Window{18394c6 u0 com.android.systemui.ImageWallpaper}
setInputWindows displayId=0 Window{3ec0758 u0 NavigationBar0} Window{c33f3f4 u0 StatusBar} Window{c2c39f5 u0 com.google.android.apps.nbu.files/com.google.android.apps.nbu.files.documentbrowser.filebrowser.FileBrowserRegularActivity} Window{18394c6 u0 com.android.systemui.ImageWallpaper}
[156] VerifyInstallTask.d(10): VerifyApps: No APK could be parsed in multi-APK archive
[156] VerifyMissingSplitsInstallTask.mO(7): Could not tell if Splits is installed due to null packageInfo for id=11. Assuming not.
[156] VerifyMissingSplitsInstallTask.d(1): Assuming split not required due to null packageInfo for id=11
[156] VerifyPerSourceInstallationConsentInstallTask.mO(2): PSIC verification started with installer uid: 10109 package name: com.google.android.apps.nbu.files, originating uid: -1
[156] VerifyPerSourceInstallationConsentInstallTask.mO(10): Skipping logging for attempted installation. The source is a system package.
[2] VerifyInstallTask.j(2): VerifyApps: Returning package verification result id=11, result=ALLOW
[2] VerifyInstallTask.mN(7): VerifyApps: Verification complete: id=11, package_name=com.is.vitllinkSOS
Unknown element under <manifest>: meta-data at /data/app/vmdl610927314.tmp/base.apk Binary XML file line #21
Unknown element under <manifest>: meta-data at /data/app/vmdl610927314.tmp/base.apk Binary XML file line #22
Unknown element under <manifest>: meta-data at /data/app/vmdl610927314.tmp/base.apk Binary XML file line #23
Scanning Failed.
com.android.server.pm.PackageManagerException: No signature found in package of version 2 or newer for package com.is.vitllinkSOS
    at com.android.server.pm.PackageManagerService.assertPackageIsValid(PackageManagerService.java:12342)
    at com.android.server.pm.PackageManagerService.scanPackageNewLI(PackageManagerService.java:11141)
    at com.android.server.pm.PackageManagerService.scanPackageTracedLI(PackageManagerService.java:10901)
    at com.android.server.pm.PackageManagerService.installPackagesLI(PackageManagerService.java:17023)
    at com.android.server.pm.PackageManagerService.installPackagesTracedLI(PackageManagerService.java:16394)
    at com.android.server.pm.PackageManagerService.lambda$processInstallRequestsAsync$22$PackageManagerService(PackageManagerService.java:14533)
    at com.android.server.pm.-$$Lambda$PackageManagerService$9znobjOH7ab0F1jsW2oFdNipS-8.run(Unknown Source:6)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:223)
    at android.os.HandlerThread.run(HandlerThread.java:67)
    at com.android.server.ServiceThread.run(ServiceThread.java:44)
Couldn't opendir /data/app/vmdl610927314.tmp: No such file or directory
Failed to delete /data/app/vmdl610927314.tmp: No such file or directory

Regards

John.
 
Last edited:
Solution
Two things to notice in the logs, #1-Malformed package, #2-No signature found in package of version 2 or newer for package com.is.vitllinkSOS

The tool signapk is the version 2 signature tool. According to Android documentation, one has to zipalign the apk before signing it. Try zipalign-ing the APK before signing it and then see if the malformed package and version issue goes away:

Links:
https://developer.android.com/studio/command-line/zipalign
https://stackoverflow.com/a/36917040

OliverA

Expert
Licensed User
Longtime User
Two things to notice in the logs, #1-Malformed package, #2-No signature found in package of version 2 or newer for package com.is.vitllinkSOS

The tool signapk is the version 2 signature tool. According to Android documentation, one has to zipalign the apk before signing it. Try zipalign-ing the APK before signing it and then see if the malformed package and version issue goes away:

Links:
https://developer.android.com/studio/command-line/zipalign
https://stackoverflow.com/a/36917040
 
Upvote 1
Solution
Cookies are required to use this site. You must accept them to continue using the site. Learn more…