Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 5 support #2460

Closed
chrisekelley opened this issue Nov 3, 2020 · 7 comments
Closed

Android 5 support #2460

chrisekelley opened this issue Nov 3, 2020 · 7 comments
Assignees
Labels
blocker bug Education Project Priority regression Some issue where it worked in a prior release but not now.
Milestone

Comments

@chrisekelley
Copy link
Member

chrisekelley commented Nov 3, 2020

@lachko reported an issue w/ an Android 5 tab not being able to install a Tangerine APK. I checked the config.json settings:

    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />

API 21 is Android 5.

but I do see this bug that shows how this setting could be ignored:

apache/cordova-android#686 (comment)

@lachko
Copy link
Contributor

lachko commented Nov 18, 2020

Here is the output of a generated apk checking what the min version is. It shows that 21 is not built in. Please bump this to a high priority for resolving

aapt dump badging ~/Downloads/trial.apk
package: name='org.rti.tangerine' versionCode='1' versionName='0.0.1' compileSdkVersion='29' compileSdkVersionCodename='10'
sdkVersion:'22'
targetSdkVersion:'29'

@lachko lachko added bug regression Some issue where it worked in a prior release but not now. blocker labels Nov 18, 2020
@chrisekelley
Copy link
Member Author

chrisekelley commented Feb 2, 2021

When I force the sdk version using cordova build --no-telemetry android -- --gradleArg=-PcdvMinSdkVersion=21 , I get the following error:

> Task :app:processDebugManifest FAILED
/tangerine/client/releases/qa/apks/group-b1adf7e0-9f93-47ec-988c-1e4af596c721/platforms/android/app/src/main/AndroidManifest.xml Error:
        uses-sdk:minSdkVersion 21 cannot be smaller than version 22 declared in library [:CordovaLib] /tangerine/client/releases/qa/apks/group-b1adf7e0-9f93-47ec-988c-1e4af596c721/platforms/android/CordovaLib/build/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 21
        Suggestion: use a compatible library with a minSdk of at most 21,
                or increase this project's minSdk version to at least 22,
                or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)

Here is an issue related to why android-21 is no longer supported: apache/cordova-android#915 (comment)

Relevant part:

- Android 5.0 was deemed to have an insignificant market share
- Android 5.0 was known to be buggy with severe memory leaks, which were resolved in 5.1
- Apparently not all vendors implemented the updatable webview in Android 5.0.

@chrisekelley
Copy link
Member Author

chrisekelley commented Feb 2, 2021

This morning i'm testing to see if it will build w/ android-cordova-8.x. If this works (so far, no luck) I will add a switch for groups that need to maintain compatibility with Android 5.

@chrisekelley
Copy link
Member Author

chrisekelley commented Feb 2, 2021

Setting cordova platform add android@8 --no-telemetry still had build errors.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Adding -stacktrace to the gradleArgs show a missing config file

cordova build --no-telemetry android -- --gradleArg=-PcdvMinSdkVersion=21 --gradleArg=-stacktrace=true

No argument was provided for command-line option '-c'.
...
-c, --settings-file                Specify the settings file.

Restting the gradle caches did not help:

rm -rf $HOME/.gradle/caches/

@chrisekelley
Copy link
Member Author

chrisekelley commented Feb 2, 2021

Suggest having a broader discussion about platform support in Tangerine. Some options:

  • Need to store the android version and tablet model. This will give us a better idea what platforms we need to support.
  • Propose pinning the cordova and cordova-android versions in the app-config.json.
  • Have a different branch for docker-tangerine-base-image for legacy versions, such as Android 9 support. If the docker container starts up and a group is configured for a different Cordova version, don't generate APK's until this is sorted. Can we run multiple cordova's on an instance? Update: At the moment, it would be better that the cordova version be instance-wide - not at the group level.
  • Cordova is installed globally (npm install -g). May be better to instal on npde_modules and supply the full path when generating apk's. This will help supporting different Cordova versions..

@chrisekelley
Copy link
Member Author

One last thing: I installed Cordova 9 on my instance (Cordova 10 comes in the latest docker-tangerine-base-image), did cordova clean and rm -rf $HOME/.gradle/caches/ but still got the same error:

> Failed to notify project evaluation listener.
   > org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;

@chrisekelley
Copy link
Member Author

I checked if we could easily pull an older docker-tangerine-base-image to support cordova 9 or older. Unfortunately, the Dockerfile does not specify a cordova version when doing an npm install in older commits. Also, some of the older versions may not have the correct sqlite plugin. We could start from the v3.5.4 tag and modify the cordova version - that version has the current sqlite version ( (unstable-build-2020-07-15-01)): Tangerine-Community/docker-tangerine-base-image@bd3758f#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557

@lachko lachko closed this as completed Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker bug Education Project Priority regression Some issue where it worked in a prior release but not now.
Projects
None yet
Development

No branches or pull requests

2 participants