Troubleshoot Android SDK

Gradle dependency conflict errors in installation

The HyperTrack SDK includes following dependencies:

Name Version Description
Google Play Services libraries 11.8.0 This includes play-services-gcm, play-services-location, play-services-maps and play-services-places libraries
Firebase Messaging library 11.8.0 For FCM support
Android v7 support 27.0.2 For PlaceSelector widget: this includesrecyclerview-v7 and cardview-v7 libraries.
Android Volley library 1.0.0 For HTTP networking
Gson library 2.8.0 For data serialization and deserialization
SmartScheduler 0.0.11 For job scheduling
HyperLog 0.0.8 For storing logs into database and push them to remote server for debugging.

The latest version of these libraries will be automatically included as transitive dependencies. To exclude transitive dependencies to resolve version conflicts, you can exclude them by specifying transitive = false and including all the above mentioned dependencies separately. Once you have, clear your Gradle cache and sync your project.

Change SDK Dependencies Versions

  • Goto project-level build.gradle file.
  • Inside buildscript block define extra properties.
buildscript {

    //Android v7 Support Library Version
    ext.library_support_version = '27.0.2'

    //Google Play Services Libraries Version
    ext.library_play_service_version = '11.8.0'

    //Compile SDK Version
    ext.library_compile_sdk_version = 26

    //Build Tool Version
    ext.library_build_tools_version = '26.0.3'

    repositories {
        jcenter()
        mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.1.0'
        classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
  • Sync Gradle

Use different versions of these Gradle dependencies

By default the HyperTrack SDK includes the above mentioned libraries with their versions as specified. In case a different version of one of these library is a dependency to your app or to another library you have integrated, you can follow the following step to resolve this conflict. You will have to remove the required dependecy from the HyperTrack SDK by using exclude command and manually add these dependencies separately. Once you have, clear your Gradle cache and sync your project.

repositories {
    maven {
      url "http://hypertrack-android-sdk.s3-website-us-west-2.amazonaws.com/"
    }
}

dependencies {
    ...

    /**
     * Add com.google.firebase and com.google.android.gms dependencies of the
     * version that you have included or want to include.
     */
    compile 'com.google.firebase:firebase-messaging:11.6.0'
    compile 'com.google.android.gms:play-services-gcm:11.6.0'
    compile 'com.google.android.gms:play-services-location:11.6.0'
    compile 'com.google.android.gms:play-services-maps:11.6.0'
    compile 'com.google.android.gms:play-services-places:11.6.0'

    ...

    /**
     * Exclude com.google.firebase and com.google.android.gms dependencies
     * from HyperTrack SDK dependency for versions other than what is being
     * used by the HyperTrack SDK.
     */
    compile("com.hypertrack:android:7:release@aar") {
        transitive = true;
        exclude group: 'com.google.firebase', module: 'firebase-messaging'
        exclude group: 'com.google.android.gms', module: 'play-services'
    }

    ...
}

Persistent SDK notification

Why is this required?

  • By default, HyperTrack runs as a service in the background to collect data. However, background services can be killed and restarted by the OS. The OS may do this when it needs to allocate memory to other tasks (for example, to display a large page in the browser) or to conserve battery. The OS will then restart the HyperTrack service automatically when resources are available again.

  • This killing and restarting by the OS often results in patches with missing data. To get higher fidelity tracking with HyperTrack, it is recommended that you use HyperTrack as a foreground service. This is also the default option.

  • Android O is coming up with restrictions on background updates which will also need for HyperTrack SDKs to run as a foreground service for location limits.

  • You can customize this notification by following our customize guide.

Disabling persistent notification

If your app is a consumer app and you want the location tracking to happen silently, then you may want to disable the notification. It can be done by calling HyperTrack.disablePersistentNotification(true). You need to call this only once on a device. This setting is purged only if the app is deleted. By default, persistent notification is enabled when the sdk is integrated. Note that location tracking will be still useful though less reliable if the notification is disabled.

results matching ""

    No results matching ""