Complete
over 4 years ago

TOYSTORE-1757

Fixed

Android Mobile SDK fails to initialize Connect IQ if compiling using Android SDK 30 and running on Android 11 devices

I've encountered a weird issue when compiling my Android companion app with Android SDK 30 and running on physical Android 11 devices. (tested on Samsung S21 and Pixel 2 XL running Android 11). 

ConnectIQ fails to initialize after:

mConnectIQ = ConnectIQ.getInstance(this, ConnectIQ.IQConnectType.WIRELESS);
mConnectIQ.initialize(this, true, mCIQListener);

The listener's onInitializeError() will be invoked with error status: GCM_NOT_INSTALLED even though Garmin Connect Mobile is correctly installed. 

If I change build.gradle to use compileSdkVersion 29, the initialization will succeed and my companion app works flawlessly. 

Note that this issue does not seem to appear on Android 10 devices. I don't test older Android version though but. I assume this issue only applies to Android 11.

Parents Comment Children
  • hey have to tried setting 'ConnectIQ.IQConnectType' to 'TETHERED'? I was able to resolve this issue using the following code:

    ```

    val connectIQ = ConnectIQ.getInstance(this, ConnectIQ.IQConnectType.TETHERED);
    connectIQ.initialize(this, true, object : ConnectIQ.ConnectIQListener {
    // Called when the SDK has been successfully initialized
    override fun onSdkReady() {
    // do any post initialization setup
    textView.setText("Garmin Connect IQ Ready!")
    }
    })

    ```