e-mission / e-mission-docs

Repository for docs and issues. If you need help, please file an issue here. Public conversations are better for open source projects than private email.
https://e-mission.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
15 stars 32 forks source link

⬆️ Upgrade to latest everything 🎉 #680

Closed shankari closed 2 years ago

shankari commented 2 years ago

At long last, after clearing the decks with https://github.com/e-mission/e-mission-phone/pull/799 https://github.com/e-mission/e-mission-phone/pull/800 https://github.com/e-mission/e-mission-phone/pull/801 https://github.com/e-mission/e-mission-phone/pull/802

I'm ready to start the annual ritual of upgrading to the most recent version of everything. I will also plan to address https://github.com/e-mission/e-mission-docs/issues/678 and add silent push notifications to android as well to address https://github.com/e-mission/e-mission-docs/issues/677

shankari commented 2 years ago

Switched to cordova android@10.1.0, which is the most recent version (https://cordova.apache.org/announcements/2021/08/16/cordova-android-10.1.0.html).

It generated a warning about the targetSDK version being 30+, which is also required for any updates to the play store.

Looking at the behavior changes between android 10 (API 29) and android 11 (API 30), we have: https://developer.android.com/about/versions/11/behavior-changes-all

shankari commented 2 years ago

ok, so the hibernation changes are pretty evil and are going to get more evil in android 12 (API 31). In API 31, if the app is not launched (in the foreground) "for a few months", the app hibernates.

In API 30, the app runtime permissions (including location) are reset. In API 31:

This is pretty darn terrible. The location permission will be reset, and we won't have the ability to notify the user that anything is wrong through notifications.

Apparently, if your app is primarily targets with background operation, you can ask users to exempt the app from hibernation. We are going to have to go down this route; fortunately, there is a programmatic way to do this. https://developer.android.com/topic/performance/app-hibernation#exemption

Maybe we should just upgrade to API 31 right now and be a bit more future-proof. Let's see what other changes API 31 needs.

shankari commented 2 years ago

Note also that we can't put this off forever because, in Dec 2021, this reset permission is going to come to devices that: "Runs Android 6.0 (API level 23) to Android 10 (API level 29), inclusive, and is powered by Google Play services" as long as the targetSDK is 11. And we need targetSDK 11 for any native code updates.

So we may be able to limp along for a bit but will have to deal with it fully sometime.

shankari commented 2 years ago

Maybe we should just upgrade to API 31 right now and be a bit more future-proof. Let's see what other changes API 31 needs. https://developer.android.com/about/versions/12/behavior-changes-all

shankari commented 2 years ago

The foreground service launch restrictions are the worst. Basically, we can't restart the foreground service except for exemptions. Most of those don't apply.

shankari commented 2 years ago

Given the number of changes in android 12, including the foreground service changes, and the ominous "motion sensor rate limiting", I am going to stick with android 11 for now.

I will add the hibernation check for now, to get that out of the way, although it is less important with target API 30, where background operations and notifications are not restricted.

shankari commented 2 years ago

First, upgrading android...

$ npx cordova platform rm android
Removing android from cordova.platforms array in package.json
$ rm -rf plugins/
$ rm -rf platforms/
$ npx cordova platform add android@10.1.0
Installing "cordova-plugin-local-notification" for android
android-sdk version check failed (/Users/kshankar/e-mission/e-mission-phone/platforms/android/cordova/android_sdk_version), continuing anyways.
...
Subproject Path: CordovaLib
Subproject Path: app
Adding phonegap-plugin-barcodescanner to package.json
config file *-Info.plist requested for changes not found at /Users/kshankar/e-mission/e-mission-phone/platforms/android/*-Info.plist, ignoring
config file *-Info.plist requested for changes not found at /Users/kshankar/e-mission/e-mission-phone/platforms/android/*-Info.plist, ignoring
config file *-Info.plist requested for changes not found at /Users/kshankar/e-mission/e-mission-phone/platforms/android/*-Info.plist, ignoring
cordova-plugin-androidx-adapter: Processed 160 source files in 5938ms
$ npx cordova build android
> Task :app:compileDebugJavaWithJavac
/Users/kshankar/e-mission/e-mission-phone/platforms/android/app/src/main/java/org/apache/cordova/whitelist/WhitelistPlugin.java:25: error: cannot find symbol
import org.apache.cordova.Whitelist;
                         ^
  symbol:   class Whitelist
  location: package org.apache.cordova
/Users/kshankar/e-mission/e-mission-phone/platforms/android/app/src/main/java/org/apache/cordova/whitelist/WhitelistPlugin.java:32: error: cannot find symbol
    private Whitelist allowedNavigations;
shankari commented 2 years ago

Whitelist is deprecated in cordova android 10.x and greater (https://github.com/apache/cordova-plugin-whitelist). However, removing it requires updating the ionic plugin.

$ npx cordova plugin rm cordova-plugin-whitelist
The plugin 'cordova-plugin-whitelist' is required by (cordova-plugin-ionic), skipping uninstallation. (try --force if trying to update)
shankari commented 2 years ago

We are currently at cordova-plugin-ionic 5.4.7, currently latest is 5.5.1, so hopefully we won't have too much of an interface change. And the whitelist dependency was removed in https://github.com/ionic-team/cordova-plugin-ionic/commit/34a202e0c444d11b54664c7918219d88e8dfac6c#diff-6813833f33103dfcaa583d4f09e06dc84c0ce8ddd34c8b567b56c9728be58389 in v5.5.0, so upgrading to v5.5.1 should be good enough.

Builds now!!

BUILD SUCCESSFUL in 11s
49 actionable tasks: 18 executed, 31 up-to-date
Built the following apk(s):
    /Users/kshankar/e-mission/e-mission-phone/platforms/android/app/build/outputs/apk/debug/app-debug.apk
shankari commented 2 years ago

Note other android 10 updates (https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html), notably:

shankari commented 2 years ago

wrt file:// plugins, we use them only in the context of the post-trip prompt.

www//js/incident/post-trip-prompt.js|51| icon: 'file://img/icon.png',
www//js/survey/multilabel/post-trip-prompt.js|54| icon: 'file://img/icon.png',
www//js/control/general-settings.js|242| icon: 'file://img/icon.png',

so we need to see how the local notifications work with it. If this is too complex, I may drop support for the trip end notifications plugin.

Fortunately, it is pretty clear that since we were using the webview plugin all along, it won't really affect us in many other ways. https://github.com/apache/cordova-android/pull/1137#issuecomment-824895347

I'm going to downgrade the priority of this.

shankari commented 2 years ago

Android Studio cannot open the project, though. "Gradle sync failed: This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 4.2 or newer."

Trying to figure out how to upgrade the android support plugin. Might just upgrade to a newer version of Android studio if it is easier.

shankari commented 2 years ago

Looks like we can fix it either by downgrading gradle or upgrading android studio. Since a major upgrade to gradle 7.1.1 was part of the cordova 10 upgrade, we will upgrade android studio.

UPDATE: Runs fine after updating

Screen Shot 2021-10-17 at 1 20 12 PM

.

shankari commented 2 years ago

Now, let's upgrade the external plugins.

cordova-plugin-advanced-http 3.0.0 "Advanced HTTP plugin"   -> 3.2.2
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter" -> unchanged
cordova-plugin-app-version 0.1.9 "AppVersion" -> 0.1.12 (deprecated, do we need?)
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-customurlscheme 5.0.1 "Custom URL scheme" -> 5.0.2
cordova-plugin-device 2.0.1 "Device" -> 2.0.3

cordova-plugin-em-datacollection 1.6.0 "DataCollection"
cordova-plugin-em-jwt-auth 1.6.4 "JWTAuth"
cordova-plugin-em-server-communication 1.2.3 "ServerComm"
cordova-plugin-em-serversync 1.2.5 "ServerSync"
cordova-plugin-em-settings 1.2.2 "ConnectionSettings"
cordova-plugin-em-transition-notify 1.2.6 "TransitionNotification"
cordova-plugin-em-unifiedlogger 1.3.3 "UnifiedLogger"
cordova-plugin-em-usercache 1.1.3 "UserCache"

cordova-plugin-email-composer 0.9.2 "EmailComposer" -> unchanged (remove? now that we have upload functionality)
cordova-plugin-file 6.0.2 "File" -> unchanged (remove? I think we use this primarily for the email)
cordova-plugin-inappbrowser 4.0.0 "InAppBrowser" -> 5.0.0
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard" -> unchanged (do we even need this?)
cordova-plugin-ionic-webview 5.0.0 "cordova-plugin-ionic-webview" -> unchanged
cordova-plugin-ionic 5.4.7 "cordova-plugin-ionic" -> 5.5.1
cordova-plugin-local-notification 0.9.0-beta.3 "LocalNotification" -> unchanged (remove or migrate to the maintained fork?)
cordova-plugin-x-socialsharing 6.0.0 "SocialSharing" -> 6.0.3
cordova-support-google-services 1.3.2 "cordova-support-google-services"
es6-promise-plugin 4.2.2 "Promise"
phonegap-plugin-barcodescanner 8.1.0 "BarcodeScanner" -> see below
phonegap-plugin-multidex 1.0.0 "Multidex"
phonegap-plugin-push 2.3.0 "PushPlugin" -> see below

The two complicated upgrades are:

shankari commented 2 years ago

Getting some errors with building pods

Failed to install 'cordova-plugin-em-jwt-auth': Error: pod: Command failed with exit code 31
    at ChildProcess.whenDone (/Users/kshankar/e-mission/e-mission-phone/node_modules/cordova-common/src/superspawn.js:136:25)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1051:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
Failed to restore plugin "cordova-plugin-em-jwt-auth". You might need to try adding it again. Error: Error: pod: Command failed with exit code 31

and

Failed to install 'cordova-plugin-em-datacollection': Error: pod: Command failed with exit code 31
    at ChildProcess.whenDone (/Users/kshankar/e-mission/e-mission-phone/node_modules/cordova-common/src/superspawn.js:136:25)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1051:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
Failed to restore plugin "cordova-plugin-em-datacollection". You might need to try adding it again. Error: Error: pod: Command failed with exit code 31

Before resetting everything, I got a similar error with the new @havesource/cordova-plugin-push plugin. Let's try to investigate this further.

I am still getting the same error for that plugin.

$ npx cordova plugin rm @havesource/cordova-plugin-push
Uninstalling @havesource/cordova-plugin-push from android
Subproject Path: CordovaLib
Subproject Path: app
Uninstalling @havesource/cordova-plugin-push from ios
Running command: pod install --verbose
Removing "@havesource/cordova-plugin-push"
Removing @havesource/cordova-plugin-push from package.json
kshankar-35069s:e-mission-phone kshankar$ npx cordova plugin add @havesource/cordova-plugin-push
Installing "@havesource/cordova-plugin-push" for android
Subproject Path: CordovaLib
Subproject Path: app
Installing "@havesource/cordova-plugin-push" for ios
Running command: pod install --verbose
Failed to install '@havesource/cordova-plugin-push': Error: pod: Command failed with exit code 31
    at ChildProcess.whenDone (/Users/kshankar/e-mission/e-mission-phone/node_modules/cordova-common/src/superspawn.js:136:25)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1051:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
pod: Command failed with exit code 31
shankari commented 2 years ago

updated the pod repo

$ pod repo update

per https://github.com/dpa99c/cordova-plugin-firebasex/issues/43#issuecomment-511832882 AND upgraded to latest version of cocoapods using the standard install command without a version

gem install --no-document --user-install cocoapods -v $COCOAPODS_VERSION

and then upgrading the version to the selected 1.11.2

works! but with this error

[!] The `emission [Debug]` target overrides the `LD_RUNPATH_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-emission/Pods-emission.debug.xcconfig'. This can lead to problems with the CocoaPods installation
shankari commented 2 years ago

We are now down to 25 plugins, presumably

Found       25 plugins, expected 27
Found       25 plugins, expected 27, retrying

Presumably this is because

feat: remove cordova-support-google-services dependency #8
breaking(android): drop phonegap-plugin-multidex dependency #21

and those plugins have indeed been removed.

shankari commented 2 years ago

android build succeeds. iOS build fails with error

fatal error: 'AppAuth.h' file not found

Builds fine using xcode and launches in a 14.4 emulator.

shankari commented 2 years ago

At this point, I am going to test a bit and then push out the first version of the beta releases for testing. At least this will get the beta testing pipeline working. Then, as part of upgrading the cordova-jwt-auth plugin, I can determine what to do about AppAuth.

shankari commented 2 years ago

Upgraded gradle plugin, but then build on android studio failed with error

Could not find method compile() for arguments me.leolin:ShortcutBadger

Tried:

It seems to work now, need to see which one fixed it. Also needed to change to JDK 11 (https://stackoverflow.com/a/69174666/4040267) Needed to change also while compiling from the CLI

export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/Contents/Home

With that fix, we were able to recompile after enabling cleartext traffic during debugging ONLY. We can now launch the app and go through the onboarding on both android and iOS.

Screen Shot 2021-10-17 at 11 44 05 PM

I will plan on merging these changes to the CEO branch and starting beta testing tomorrow. Still need to:

shankari commented 2 years ago

@PatGendre @asiripanich @kafitz @jf87 anybody want to help test as I upgrade everything again?

shankari commented 2 years ago

ios build failed CI (expected) android build also failed CI (unexpected)

Cleared everything and reinstalled from scratch. Now I'm getting the same android error.

/Users/kshankar/e-mission/e-mission-phone/platforms/android/app/src/main/java/com/adobe/phonegap/push/PushInstanceIDListenerService.java:6: error: cannot find symbol
import com.google.firebase.iid.InstanceIdResult;
...
/Users/kshankar/e-mission/e-mission-phone/platforms/android/app/src/main/java/com/adobe/phonegap/push/PushInstanceIDListenerService.java:17: error: cannot find symbol
    FirebaseInstanceId.getInstance().getInstanceId()
                                    ^
  symbol:   method getInstanceId()
  location: class FirebaseInstanceId
asiripanich commented 2 years ago

@PatGendre @asiripanich @kafitz @jf87 anybody want to help test as I upgrade everything again?

happy to help. ;)

shankari commented 2 years ago

Found the same issue in the push plugin repo, but the working version from the user is on cordova-android9 https://github.com/havesource/cordova-plugin-push/issues/83#issuecomment-778780823

The most obvious error is while trying to import https://firebase.google.com/docs/reference/android/com/google/firebase/iid/InstanceIdResult which is deprecated.

Trying to use the same FCM version as https://github.com/havesource/cordova-plugin-push/issues/83#issuecomment-778780823

shankari commented 2 years ago

Archived and uploaded 1.2.0 (20) to itunes connect last night after some wrestling with the signing permissions.

Unfortunately, found a silly error while testing in the emulator - had to change the survey launch to match https://github.com/e-mission/e-mission-phone/pull/799/commits/a3623e10f0fd4972d8c27ceb7dc50e980a716910

Fixed and uploaded 1.2.1 (21) to itunes. Sent invite to beta users.

shankari commented 2 years ago

Android is a bit trickier because we need to change our upload process to support the aab bundles. It looks like apk is also available for older apps, so we could use that workaround for now, but what better time to make the inevitable change than during a formal upgrade process.

shankari commented 2 years ago

Testing android on the emulator first (after being bitten by a weird bug on iOS). The survey stuff works fine, but we appear to have a persistent error with reading the location.

2021-10-19 10:46:34.871 2797-4233/gov.colorado.energyoffice.emission E/CreateGeofenceAction: Reading last location failed with error com.google.android.gms.common.api.ApiException: 17: API: LocationServices.API is not available on this device. while creating geofence
PatGendre commented 2 years ago

@PatGendre @asiripanich @kafitz @jf87 anybody want to help test as I upgrade everything again?

happy to help. ;)

Hi, the test would with the canbikeCO app ?

shankari commented 2 years ago

yes. I might also use emTripLog if people are not comfortable with CanBikeCO, but it is easiest for me to maintain one app. And eventually, we want to have an NREL equivalent of emTripLog, so updating emTripLog is not a long-term benefit.

shankari commented 2 years ago

Phew! https://github.com/e-mission/e-mission-docs/issues/680#issuecomment-946975792 is just because the emulators didn't have Google Play Services installed. Should improve the error reporting around this because "unknown error" is not very useful and won't help people figure out what is wrong.

shankari commented 2 years ago

seeing no obvious errors, starting the aab push to google. First step is to opt-in to aab publishing. Need to really want to do this because it is a one-way street.

Considering using a standard apk for now and getting approval from legal before switching. But CanBikeCO is on my personal account; we should get NREL legal involved for the NREL account. And that might be a new app anyway and require aab.

shankari commented 2 years ago

Tried with apk, failed

You uploaded an APK with an invalid signature (learn more about signing). Error from apksigner: ERROR: MIN_SIG_SCHEME_FOR_TARGET_SDK_NOT_MET: Target SDK version 30 requires a minimum of signature scheme v2; the APK is not signed with this or a later signature scheme

Maybe it is just easier to work with aab after all.

Uploaded the exported key. Not creating a separate upload key just yet since CanBikeCO will only live for a few more years.

Am supposed to "keep signing the aab" with the existing app signing key. what does that mean? do we still use zipalign?

shankari commented 2 years ago

Got warning while signing aab:

The signer's certificate is self-signed.
The RSA signing key has a keysize of 1024 which is considered a security risk. This key size will be disabled in a future update.

Should I have used a new signing key? How would that have even worked? I thought you had to export your signing key to start. Anyway, you can reset your key once, and this app is only valid for 2 more years, so it's probably OK.

Pretty clear that we couldn't have, so this was inevitable. I do wonder how they plan to deal with key lengths over the long term. They keep expanding, and we can only request a new key once.

shankari commented 2 years ago

aab uploaded and pushed out. Now going to tackle OpenPATH plugin updates...

shankari commented 2 years ago

@ericafenyo FYI since you may want to upgrade the native library after the OpenPATH updates are done.

shankari commented 2 years ago

Back to this issue now...

While building on android, I see

Adding classpath: com.google.gms:google-services:4.3.3
WARNING:: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed in version 7.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.

So it looks like the Android Gradle plugin (which I had upgraded to 7.x using android studio) https://github.com/e-mission/e-mission-docs/issues/680#issuecomment-945401137 has been reverted.

So maybe the hack of using the master version of the plugin can also be reverted?

shankari commented 2 years ago

Noticed the following logs in the android build

Adding classpath: com.google.gms:google-services:4.3.3
WARNING:: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed in version 7.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.

So it looks like the upgrade to version 7.0 of the Android Gradle plugin was reverted when starting with a clean build. In that case, do we need to pin the version of the badger plugin? https://github.com/e-mission/e-mission-docs/issues/680#issuecomment-945401137

Removed the pinned version

$ npx cordova plugin list | grep badge
cordova-plugin-badge 0.8.8 "Badge"

$ grep -r compile plugins/cordova-plugin-badge/
plugins/cordova-plugin-badge//LICENSE:      not limited to compiled object code, generated documentation,
plugins/cordova-plugin-badge//src/android/badge.gradle:        compile "me.leolin:ShortcutBadger:${appShortcutBadgerVersion}@aar"

$ tail -n 5 plugins/cordova-plugin-badge//src/android/badge.gradle
if (!project.ext.has('appShortcutBadgerCustom')) {
    dependencies {
        compile "me.leolin:ShortcutBadger:${appShortcutBadgerVersion}@aar"
    }
}

compared to https://github.com/katzer/cordova-plugin-badge/blob/master/src/android/badge.gradle#L28

if (!project.ext.has('appShortcutBadgerVersion')) {
    ext.appShortcutBadgerVersion = '1.1.22'
}

if (!project.ext.has('appShortcutBadgerCustom')) {
    dependencies {
        compile "me.leolin:ShortcutBadger:${appShortcutBadgerVersion}@aar"
    }
}

and ensured that the gradle workaround was also removed. Android still builds.

$ grep -r appShortcutBadgerVersion platforms/
platforms//android/cordova-plugin-local-notification/emission-localnotification.gradle:if (!project.ext.has('appShortcutBadgerVersion')) {
platforms//android/cordova-plugin-local-notification/emission-localnotification.gradle:    ext.appShortcutBadgerVersion = '1.1.19'
platforms//android/cordova-plugin-local-notification/emission-localnotification.gradle:    compile "me.leolin:ShortcutBadger:${appShortcutBadgerVersion}@aar"
platforms//android/cordova-plugin-badge/emission-badge.gradle:if (!project.ext.has('appShortcutBadgerVersion')) {
platforms//android/cordova-plugin-badge/emission-badge.gradle:    ext.appShortcutBadgerVersion = '1.1.22'
platforms//android/cordova-plugin-badge/emission-badge.gradle:        compile "me.leolin:ShortcutBadger:${appShortcutBadgerVersion}@aar"
shankari commented 2 years ago

Next, we need to fix the iOS build. Let's do this by migrating the OpenPATH JWT plugin.

shankari commented 2 years ago
  1. First, let's change from <framework of type podspec to <podspec>
    • Builds, gives same error.

But removing the plugin now gives an error

$ npx cordova plugin rm cordova-plugin-em-jwt-auth
Uninstalling cordova-plugin-em-jwt-auth from android
Subproject Path: CordovaLib
Subproject Path: app
Uninstalling cordova-plugin-em-jwt-auth from ios
Cannot convert undefined or null to object

$ npx cordova plugin rm cordova-plugin-em-jwt-auth
Uninstalling cordova-plugin-em-jwt-auth from android
Subproject Path: CordovaLib
Subproject Path: app
Uninstalling cordova-plugin-em-jwt-auth from ios
Cannot convert undefined or null to object

Investigating further before filing an issue.

shankari commented 2 years ago

This turned out to be the lack of a <config tag, similar to https://github.com/apache/cordova-ios/issues/913 except that in my case, the plugin installed correctly, but could not be removed. After adding a config similar to the one from the push plugin

      <config>
        <source url="https://cdn.cocoapods.org/"/>
      </config>

Our plugin was also removed correctly

$ npx cordova plugin rm cordova-plugin-em-jwt-auth
Uninstalling cordova-plugin-em-jwt-auth from android
Subproject Path: CordovaLib
Subproject Path: app
Uninstalling cordova-plugin-em-jwt-auth from ios
Running command: pod install --verbose

[!] The `emission [Debug]` target overrides the `LD_RUNPATH_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-emission/Pods-emission.debug.xcconfig'. This can lead to problems with the CocoaPods installation

[!] The `emission [Release]` target overrides the `LD_RUNPATH_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-emission/Pods-emission.release.xcconfig'. This can lead to problems with the CocoaPods installation

Removing "cordova-plugin-em-jwt-auth"
Removing cordova-plugin-em-jwt-auth from package.json

Yay!

shankari commented 2 years ago

Upgraded to

        <pod name="GoogleSignIn" spec="~> 6.0.2" />
        <pod name="AppAuth" spec="~> 1.4.0" />
        <pod name="JWT" spec="~> 3.0.0-beta.14" />

and still have the same error

This is not surprising since we don't see this error in XCode, so the files are clearly there. This is probably related to some path issues with building...

shankari commented 2 years ago

After the upgrades, see this error in xcode.

platforms/ios/emission/Plugins/cordova-plugin-em-jwt-auth/GoogleSigninAuth.m:63:33: No visible @interface for 'GIDSignIn' declares the selector 'restorePreviousSignIn'

which seems to be related to a deprecation change. https://github.com/google/GoogleSignIn-iOS/blob/main/CHANGELOG.md#600-2021-7-13

shankari commented 2 years ago

🗑️ If the OpenID Auth functionality is not currently used, I might deprecate it in the next release and remove in 2 releases later. So if you do use this functionality, please speak up! 🗑️

shankari commented 2 years ago

Checking which other plugins need to be updated...

$ find . -name \*plugin.xml | xargs grep framework
./cordova-usercache/plugin.xml:    <framework src="libsqlite3.0.tbd"/>
./cordova-server-communication/plugin.xml:  <framework src="src/android/httplib.gradle" custom="true" type="gradleReference" />
./e-mission-data-collection/plugin.xml:    <framework src="com.google.code.gson:gson:2.8.5"/>
./e-mission-data-collection/plugin.xml:    <framework src="com.google.android.gms:play-services-location:$LOCATION_VERSION"/>
./e-mission-data-collection/plugin.xml:    <framework src="Bolts/Tasks" type="podspec" spec="~> 1.9.0"/>
./e-mission-data-collection/plugin.xml:    <framework src="CoreLocation.framework"/>
./e-mission-data-collection/plugin.xml:    <framework src="Accounts.framework"/>
./cordova-jwt-auth/plugin.xml:    <framework src="com.google.android.gms:play-services-auth:$AUTH_VERSION"/>
./cordova-jwt-auth/plugin.xml:    <framework src="net.openid:appauth:0.10.0"/>
./cordova-jwt-auth/plugin.xml:    <framework src="com.auth0.android:jwtdecode:2.0.0"/>
./cordova-jwt-auth/plugin.xml:    <framework src="src/android/openid-config.gradle" custom="true" type="gradleReference" />
./cordova-jwt-auth/plugin.xml:    <framework src="SystemConfiguration.framework"/>
./cordova-jwt-auth/plugin.xml:    <framework src="Security.framework"/>
./cordova-jwt-auth/plugin.xml:      <pods use-frameworks="true">
./cordova-server-sync/plugin.xml:    <framework src="CoreMotion.framework"/>
shankari commented 2 years ago

Next step: clean up cordova-server-sync. Last step: tackle the biggie: e-mission-data-collection

Next step: tackle e-mission-data-collection because I really want to build the status screen and I don't want to run out of time on this round.

shankari commented 2 years ago

There are a bunch of deprecation messages in the data collection.

Bunch of stuff around local notification

/tmp/native_code_upgrade/native_code_upgrade/platforms/ios/emission/Plugins/cordova-plugin-em-datacollection/Location/DataUtils.m:263:9: warning: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's
UNNotificationRequest [-Wdeprecated-declarations]
        UILocalNotification *localNotif = [[UILocalNotification alloc] init];

/tmp/native_code_upgrade/native_code_upgrade/platforms/ios/emission/Plugins/cordova-plugin-em-datacollection/BEMAppDelegate.m:27:62: warning: 'UIUserNotificationTypeBadge' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNAuthorizationOptions [-Wdeprecated-declarations]
shankari commented 2 years ago

Trying to refactor the codebase to run operations in both the background and the foreground, and it is very tricky. let's consider the case of enabling the location settings, for example.

There is an existing method to check the location settings which return a task.

        Task<LocationSettingsResponse> task =
          LocationServices.getSettingsClient(ctxt).checkLocationSettings(builder.build());

Based on the task results, I want to do something different in the foreground (callback to the javascript layer) and in the background (generate notifications).

I was going to structure it as a new checkNotifications: returns a structure indicating whether the location settings are correct or not; called from both foreground and background

However, checkLocationSettings returns a Task.

Writing out the requirement makes it pretty clear what we should do. We should pass in separate background callback and foreground callbacks that handle the result appropriately. In fact, there could be a background callback and separate foreground callbacks to check and fix.

PatGendre commented 2 years ago

@PatGendre @asiripanich @kafitz @jf87 anybody want to help test as I upgrade everything again?

happy to help. ;)

Hi, the test would with the canbikeCO app ?

@shankari I upgraded the app and used it for a few days now, I didn't notice anything wrong. The new version seems near from production :-)

shankari commented 2 years ago

@PatGendre that was with upgrading everything other than the OpenPATH plugins. I am now working on updating the OpenPATH plugins.

shankari commented 2 years ago

After upgrade to Big Sur, intermittently got error while building on android

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.

* 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.

* Get more help at https://help.gradle.org

Found fix on stackoverflow (setting JAVA_HOME) which worked (https://stackoverflow.com/a/67618805/4040267)