Skip to content

Migrating to Android Mobile SDK 8.10+ with AndroidX Support

Pointr Android SDK from version 8.10.0 and up, utilizes AndroidX libraries. If your app is using support libraries, you need to migrate to AndroidX in order to integrate the Pointr Android SDK 8.10+.

There is no special configuration is required for Pointr SDK for a project to AndroidX migration. Here are guides from official Android developer site for AndroidX migration:

Note

  • Do not use variables to define library versions
  • Use implementation 'com.android.support:design:28.0.0' instead of

    def androidSupportV = '28.0.0'```
    implementation 'com.android.support:design:' + androidSupportV
    

  • Clear all variables before starting the migration and rework on variables after migration is completed.

Google Services

Pointr Android SDK 8.10.0+ uses Google Services version 4.4.0 and play-services-location version 21.0.1. If your project uses lower versions of these libraries, it is recommended to upgrade these dependencies. Otherwise, having different depencies may cause crashes because of the API changes in these libraries.

buildcript {
    ...
    dependencies {
        ...
        classpath 'com.google.gms:google-services:4.4.0'
        ...
    }
}
dependencies {
    ...
    implementation 'com.google.android.gms:play-services-location:21.0.1'
    ...
}

JAVA SDK Version

Pointr Android SDK 8.10+ is compiled using Java version 17.0.9. Your source code and project should be compatible with this Java version. If your app uses a different version of Java, change the Java version from Android Studio Project Structure / SDK Location / Gradle Settings / Gradle JDK or define JAVA_HOME environment variable to point Java version 17.

Kotlin Gradle Plugin Version

Pointr Android SDK 8.10+ uses kotlin-gradle-plugin version 1.8.10. Your project needs to be configured to use it (or above version) as well. Add the correct version of kotlin-gradle-plugin as classpath to your dependencies as indicated below:

buildcript {
    ...
    dependencies {
        ...
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10"
        ...
    }
}

With the Gradle version 6.2 and Android Studio version 4.0.1 (suggested to use these or newer versions), kotlin-android-extensions plugin is deprecated.

Remove the following line from your project:

apply plugin: 'kotlin-android-extensions'

Instead, use one of the below methods: - If your app uses Parcelable you can replace kotlin-parcelize instead of kotlin-android-extensions. - If your app uses Kotlin synthetics for view binding, use this guide to migrate to Jetpack ViewBinding or Data Binding.

Compile SDK

If you have recently changed to the newer gradle, the Android Studio IDE might give a warning about compileSDKVersion being deprecated. It is replaced with compileSDK. When using the androidx supported Pointr Library, you have 2 options for setting the compileSDK version;

  1. Make the compileSDK and targetSDK at least 33. (After making sure you check the migration docs here for 13 here for 14)
  2. The second option involves a bit more work, but in case you do not want to change your projects compileSDK version, you should;
  3. Exclude the dependencies from Pointr SDK that utilize libraries that enforce a certain compile version and then add your preferred dependencies to your project.
  4. Use the below structure to exclude preferred libraries, and add as many as you like.
     implementation ("com.pointrlabs:pointr:<pointr-version>") {
            exclude group: '<group-nam>', module: '<module-name>'
            exclude group: '<group-nam>', module: '<module-name>'
        }
    

Last update: November 30, 2023
Back to top