Android 5.1.1 Support

Volt Team, absolutely love this tool - thank you. Having an issue that could use some wisdom on.

I have a number of devices, one of them is android 5.1.1

Setting the engine to 9.0.0 should support API levels 22 and Android 5.1 - 10.0.0

Android Platform Guide - Apache Cordova?

No matter what I put for the engine, I get

        <!-- <engine name="android" spec="8.0.0" /> --> (or 9.0.0)

<preference name="android-minSdkVersion" value="22" />
<preference name="android-maxSdkVersion" value="22" />

Available Android targets:
----------
id: 1 or "android-27"
     Name: Android API 27
     Type: Platform
     API level: 27
     Revision: 3
----------
id: 2 or "android-28"
     Name: Android API 28
     Type: Platform
     API level: 28
     Revision: 6
----------
id: 3 or "android-29"
     Name: Android API 29
     Type: Platform
     API level: 29
     Revision: 5
----------
id: 4 or "android-30"
     Name: Android API 30
     Type: Platform
     API level: 30
     Revision: 3

Project Installed Platforms:

    android: 9.1.0

android Environment:

    android:
ERROR: Command failed with ENOENT: android list target
spawn android ENOENT

When the app is installed on the 5.1.1 phone, I get

Describe Error
There is a problem parsing the package

The app works fine on my Android 9.0 and 10.0 devices

Questions

  1. What is the minSdk I can get with engine 9, and what is the lowest Android OS version we can target?
  2. Is there a way to support this 5.1.1 device?
  3. Am I doing something wrong?

As a reminder, I am using your service with my ASU College class, and students will have all kinds of devices both current and old, I have set the requirement to

  1. Android phone or tablet running Android 6.0 (Marshmallow, API 23) or later.

In my syllabus, do I have to change this?

Tip : If you’re pasting code, html or config files, surround the code with triple back ticks (```), before the first line and after the last one. It will be formatted properly. (We fixed it for you this time)

Setting a minimum Android level of 6 is reasonable: it was released in 2015.

We don’t have an Android 5.1.1 device here - is there anyone else on the forum who has tried this?

PS. In your description, you state

When the app is installed on the 5.1.1 phone, I get

Is there more to this?

It is a dialog box that contains exactly these words

Describe Error
There is a problem parsing the package

I think it is ok that you don’t have a 5.1.1 device, the question is how to get Android-22 as an available target? The available target list starts at android–27 and goes to android-30.

Yes, those are the only ones which are available.

Can we add targets API Levels 22 - 26?

According to the docs, Android Platform Guide - Apache Cordova

Setting the engine to 9.0.0 should support API levels 22 - 29 and thus Android 5.1 - 10.0.0

Android 5.1 (Lollipop)    needs API level 22
Android 6.0 (Marshmallow) needs API level 23 
Android 7.0 (Nougat)      needs API level 24
Android 7.1 (Nougat)      needs API level 25
Android 8.0 (Oreo)        needs API level 26
Android 8.1 (Oreo)        needs API level 27

Is your app signed? Do you get the same error if it is unsigned?

The app was NOT signed. So I just signed it and I get the Same error.

I also tested this on another Android 5.1.1 device and I get the same error.

Parse Error There is a problem parsing the package

Devices: Samsung Galaxy Prime and an LG Zone 3

Using adb, I see this when I try to install the package:

W/PackageInstaller( 5620): Parse error when parsing manifest. Discontinuing installation

Here is the manifest…

<manifest
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:versionCode="220100"
	android:versionName="22.1.0"
	android:hardwareAccelerated="true"
	android:compileSdkVersion="29"
	android:compileSdkVersionCodename="10"
	package="BWLSUFSJRA.edu.asu.cis430.f21.HelloASU"
	platformBuildVersionCode="29"
	platformBuildVersionName="10">
	<application
		android:label="(reference) @0x7f030001"
		android:icon="(reference) @0x7f020000"
		android:debuggable="true"
		android:hardwareAccelerated="true"
		android:supportsRtl="true"
		android:usesCleartextTraffic="true">
		<activity
			android:theme="(reference) @0x01030129"
			android:label="(reference) @0x7f030000"
			android:name="BWLSUFSJRA.edu.asu.cis430.f21.HelloASU.MainActivity"
			android:launchMode="1"
			android:configChanges="fb4"
			android:windowSoftInputMode="10">
			<intent-filter
				android:label="(reference) @0x7f030002">
				<category
					android:name="android.intent.category.LAUNCHER"/>
				<action
					android:name="android.intent.action.MAIN"/>
			</intent-filter>
		</activity>
	</application>
	<uses-permission
		android:name="android.permission.INTERNET"/>
	<supports-screens
		android:anyDensity="true"
		android:smallScreens="true"
		android:normalScreens="true"
		android:largeScreens="true"
		android:resizeable="true"
		android:xlargeScreens="true"/>
	<uses-sdk
		android:minSdkVersion="22"
		android:targetSdkVersion="29"/>
</manifest>

Just did a lab in class with 25 students, ios and Android all but one worked, and it was android 7.0, so 5.1.1, 6.0 and 7.0 do not work. 9+ do

An Android 6.0.1 device works just fine for me here.

I’ll DM you a link so you can try the same APK.

Thanks for the link - the APK does work on my 5.1.1 devices!

I am eager to see what you did to get it to work

I didn’t need to do anything - it just worked. It’s a simple HelloWorld app.

I sent you the files this morning (did you get them?) You might see what’s different in your project that causes the problem.

I did not get them, I only got the APK file that George sent yesterday and I have been going crazy trying to see what you did different… how did you send the whole source tree?

I zipped the files and emailed them. I’ll try WeTransfer…

I appreciate your support, I think we have a solution, and perhaps identified a weird hole that we fell into. The issue is in the config.xml widget id field…

    <widget 
        id      = "edu.asu.cis430.f21.ColorShakeMobile"  
        version = "21.2.0" 
        xmlns   = "https://www.w3.org/ns/widgets"
    >

This works on ALL version of Android (5.1.1 to current), which is what I used last few semeseters.
This semester, we added support for iOS, and I needed to change the id to include our developer team identifier as a prefix:

    <widget 
        id      = "BWLSUFSJRA.edu.asu.cis430.f21.ColorShakeMobile"  
        version = "21.2.0" 
        xmlns   = "https://www.w3.org/ns/widgets"
    >

This id works on iOS and IS REQUIRED
It also works on Android 9+
HOWEVER, it gives the “Parse Error There is a problem parsing the package” on Android 5.1.1 - 8.0.0

So, the solution is to have two different id values depending up the target.

I think the confusion is that the 2nd id, works on only Android 9+

Now, I can go through all of the my other apps and class demo’s, assignments and clear up the config.xml.

So, this leads to another question:

Should there be different config.xml for Android and iOS, are there other holes I am going to fall into or can have a single config.xml for both platforms and just change the id widget?

For anyone that falls into the same hole and is still reading… here is my solution for the unified widget that works on Android and iOS

<widget 
    id                      = "HelloASU"
    android-packageName     =            "edu.asu.cis430.f21.ASURITE.HelloASU"
    ios-CFBundleIdentifier  = "BWLSUFSJRA.edu.asu.cis430.f21.ASURITE.HelloASU"
    version                 = "22.3.0" 
    xmlns                   = "https://www.w3.org/ns/widgets">

The id is now generic, and the android-packageName and ios-CFBundleIdentifier override on the platform specific way they need.

Good work! Finding strange quirks like this is oddly satisfying.

We’ll add a warning in the docs.