Android 11 installs OK. Android 7 says file is corrupt

Installing the same debug APK, on a Pixel phone running Android 11 it installs fine, but a Huawei phone says the package is corrupt (though I was working yesterday on the same app and it installed fine) and does not install it.

Ideas?

You probably have to downgrade your minSDKVersion tag to the value for Android 7.

see: Codenames, Tags, and Build Numbers  |  Android Open Source Project

  <preference name="android-minSdkVersion" value="24" />

I have a minSdkVersion of 11 on my config. Seems to run in Appetize-io on a Nexus 5 with Android 7.1 (the phone with the issue has 7.0, but it was installing the app OK two days ago before I made some changes to config.
(App is debug)

<platform name="android">
		<preference name="android-minSdkVersion" value="11" />
		<preference name="android-targetSdkVersion" value="30" />
</platform>

If you look in the log, you can see which android-sdk is being used:

Creating Cordova project for the Android platform:
	Path: platforms/android
	Package: com.voltbuilder.hello
	Name: Hello
	Activity: MainActivity
	Android target: android-29

Log does say

Android target: android-29

Is my syntax above wrong fo config.xml?

Looks reasonable to me. What are you expecting?

Should it not say Android 30? (or is a 9 is 1 kind of thing and hence 30 is 29?

Why does does my Android 7 phone not install the debug app from Volt saying it is courrupt?

Seems I always get “android-29” no matter what I specify in the config. I do not have an AndroidManifest file

To get Android-30, add this line to config.xml:

<engine name="android" spec="10.1.1" />

More in this blog post.

I figured this out, I was wrapping android minSDK and targetSDK between platform tags.

Anyway, the key thing is that my phone running Android 7 (but not other phones running Android 7) says the APK is corrupt when compiled with android engine 9 or 10? I did manage to compile an APK that did install using Volt 2 weeks ago (presumably with android engine 9, the default). I’m worried that this issue might happen in many phones.

Still dealing with the corrupt APKs

I’m not sure this has anything to do with anything or is just a disk cluster thing, but download folder in Honor phone says size is 1.02M, while the in my hard disk the APK is 1.11M.and on a Pixel 4a running Android 11 the size is 1.14M.

I cannot afford that the app installs on some phones only.

Cordova’s policy is that they will support for Android versions which have greater than a 5% share of the installed base.

That being said, I just built, installed and run a simple app on an Android 7.0 device. It worked fine.

Could you try a simple app (like this one) and see if that installs? You would then know if the problem is something with your app or the device.

The sample app as well as a lesser app that I also do install fine on the Honor 8 running Android 7, so it is not a issue of versions. There must be something else. It cannot be a config.xml thing either as i stripped it to the bare bones (just the header, id, basic icon, name and little else, no plugins, no list of icons…)

The same app that will now not install, did install in a previous iteration some 3 weeks ago

Would you send your APK directly to support@voltbuilder.com? I’d like to try it on my device (Samsung Galaxy)

Just did.

The app also runs fine on Appetize.io

The question is why it is failing on that particular devices and on how many other devices it could also fail on. And why it failing now even with minimal config but installed fine a few weeks ago (with other iterations of config) and why other apps compiled with volt do install in the same said device

Your apk runs fine on Android 7 devices here. The only device that it doesn’t run on so far is your Honor 8. Could that device maybe be the problem?

The Honor 8 was discontinued more than 5 years ago.

It does not seem that age and android version is the problem here. It I could be sure that it is just this exact phone, there would not be an issue. Do you have a Huawei phone around to try (Honors are Huaweis)

My VoltBuilder apps, are running fine on my Android 7.0 testing device.
So I assume it is likely your specific device having problems.

I’ll also offer to test your APK if you PM it to me. My test device is an Android 7.0 Samsung Galaxy Alpha.

If you want to test your app on more 7.0 devices for peace of mind, I’ll recommend paying for browserstack.com’s Live app product.
This would cost you $39 for a month and give you access to a ton of native devices to test directly in your browser. See their available devices Android & iOS Real Devices for Manual App Testing - BrowserStack App Live