-
Notifications
You must be signed in to change notification settings - Fork 114
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
🔧 ⬆️ 🚸 Upgrade android to API 33 #1016
🔧 ⬆️ 🚸 Upgrade android to API 33 #1016
Conversation
shankari
commented
Aug 19, 2023
- ⬆️ Upgrade android to API 33
- 🔧 build script updates
- 🚸 permission usability updates
- Support building individual platforms with the prod JS but dev native code - This will allow us to test the prod JS by connecting with a debugger (if needed) - Also allows quicker dev cycle by building only one platform at a time (note that for testing outside the devapp, we need to build the app every time) - Ensures that we don't need to get off the VPN just to build iOS - Ensures that we can build prod JS iOS version for archival and submission - Support building android with the prod JS and prod native code - To support building the aab to upload to the play store Testing done: - Used for building the NREL OpenPATH app
So that we use webpack for the javascript properly Testing done: - Used to build the NREL OpenPATH app
So that we can archive it to check out old functionality if needed
@niccolopaganini for visibility into the state of this change |
Cleared the decks before starting further changes; to ensure no pollution with old state
|
We will first implement the upgrade to the cordova platform and the cordova file plugin to avoid too many overlapping changes. After making the changes to
Doh! Full logs: |
Bumped up
But still getting the same error
I can set the compileSdkVersion, but I thought that android 12 was the more recent SDK version by default.
and they are installed Are any of the plugins overriding this? |
Aha!
and
The final version is
We could change the version in data-collection, but now that we have a plethora react native components that specify a |
Setting it at the top level returns the same error
|
Ok. I am currently betting that the
Let's check on why we set this in the plugin instead of the top level |
Ah, we added it while upgrading to API 31 I filed an issue for cordova-android but added this is a workaround They re-introduced the flag in android 11, with the
which are what we want, depending on whether we want to force the targetSDK or not. So we should remove the workaround.... |
Removed
That worked! Compile was successful!
|
The app launches, but is stuck in the start screen. On connecting via the chrome debugger, looks like
After a Very Long Time, displayed this error. It is also visually very slow and sluggish |
On trying to re-launch, ran into the application timeout again. Phew! It really does appear to be almost as smooth as I had hoped. |
Created a new branch called
and rebased to it |
Removed all the overrides, build still succeeded.
|
In android 10, the cordova team removed support for `compileSdkVersion` However, in order to support auto-reset of permissions, we needed to use a later SDK than the target. After filing an issue in the cordova-android repo, we added this grade file as a workaround. However, they have now reintroduced it in android 11 apache/cordova-android#1373 (comment) *and* our compile and target SDKs have caught up anyway So we can remove the workaround. More detail at: e-mission/e-mission-phone#1016 (comment)
- `cordova-android` to 12 - `cordova-plugin-file` to 8.0.0 - Remove SDK version overrides and go with the cordova-android defaults Note that this will not work until e-mission/e-mission-data-collection#207 is merged e-mission#1016 (comment)
upgrading the android SDK fails, probably need to upgrade the java version
|
Yep! It appears to need 16+ the most recent version is 17.0.8 @Abby-Wheelis @niccolopaganini how hard was it to get IT to install a new version of java for you? I am tempted to bump this up now, but don't want to block/affect your work |
Everything should compile now. We can check in the sdk changes independently; the main goal is to start testing these changes before the release.
@niccolopaganini will wait for your review until Monday morning, otherwise I will merge since all the tests as passing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello ma'am. These changes look good to me.
One of the problems that I faced during the initial build was that the JDK version was installed differently. I was not able to build. I can try it with the updates on a separate computer and see how the changes affect. |
It took a while, but the actual install was very simple. It took 11ish days from filing the request until I got it installed, but if I had it to do over again I'd follow up sooner, I asked for an update after the request hadn't moved for about a week and ended up getting to install later that day. Since I just went through the process, I'd be happy to help anyone else that needs get the request filed. Once installed I was able to set the path and run the android emulator easily. |
The command line tools update is not critical. Given this, I will merge this now. |
This addresses updating the SDK tools to the latest versions: e-mission/e-mission-docs#934 (comment) And removing the obsolete HAXM package: e-mission/e-mission-docs#958 (comment) It also updates the README to indicate the required java version after the upgrade e-mission#1016 (comment) e-mission#1016 (comment) Testing done: After upgrading to the most recent version of OpenJDK (17) ``` $ java --version openjdk 17.0.8.1 2023-08-24 OpenJDK Runtime Environment Temurin-17.0.8.1+1 (build 17.0.8.1+1) OpenJDK 64-Bit Server VM Temurin-17.0.8.1+1 (build 17.0.8.1+1, mixed mode, sharing) ``` Android SDK install succeeds ``` $ bash setup/prereq_android_sdk_install.sh --------------------------------------- Accept? (y/N): Y [=======================================] 100% Unzipping... android-12/zipalign END: Done with android SDK download, exiting script ``` And an android build in an existing checked-out repo succeeds ``` $ npm run build-dev-android BUILD SUCCESSFUL in 33s 52 actionable tasks: 12 executed, 40 up-to-date Built the following apk(s): .../platforms/android/app/build/outputs/apk/debug/app-debug.apk ``` Albeit with several deprecated APIs ``` w: /Users/kshankar/in-house/openpath-phone/platforms/android/app/src/main/java/com/adobe/phonegap/push/FCMService.kt: (169, 17): 'get(String!): Any?' is deprecated. Deprecated in Java w: /Users/kshankar/in-house/openpath-phone/platforms/android/app/src/main/java/com/adobe/phonegap/push/FCMService.kt: (316, 20): 'get(String!): Any?' is deprecated. Deprecated in Java w: /Users/kshankar/in-house/openpath-phone/platforms/android/app/src/main/java/com/adobe/phonegap/push/FCMService.kt: (627, 33): 'constructor Builder(Context)' is deprecated. Deprecated in Java w: /Users/kshankar/in-house/openpath-phone/platforms/android/app/src/main/java/com/adobe/phonegap/push/FCMService.kt: (1190, 37): 'fromHtml(String!): Spanned!' is deprecated. Deprecated in Java w: /Users/kshankar/in-house/openpath-phone/platforms/android/app/src/main/java/com/adobe/phonegap/push/PushPlugin.kt: (97, 25): 'get(String!): Any?' is deprecated. Deprecated in Java ```