1. Home
  2. Developer Guides
  3. Android - Native
  4. Troubleshooting the Apptentive Android SDK

Troubleshooting the Apptentive Android SDK

Here are a few of the more common issues that customers have run into when integrating the Apptentive Android SDK in their app. ​

Poor Text Contrast

If the text isn’t contrasting with the background of part or all or the Apptentive UI, you may have forgotten to tell Apptentive which type of AppCompat theme your app is using. For more information, please visit our Android Interface Customization guide.

Interactions Aren’t Displaying

If you are confident that the criteria you have configured for displaying an Interaction when you engage a specific event has been met, check your logs. It could be that the criteria hasn’t really been met, or it has, but there is a problem displaying the Interaction.

Criteria Hasn’t Been Met

Sometimes you think that the criteria has been met, and that an Interaction you’ve targeted through the “Where” section of the Interaction configuration should display with you call Apptentive.engage() with that Event name. If the Interaction isn’t displaying, check the logs in Verbose mode. We print out the results of the criteria evaluation to help debug which piece is causing the evaluation to fail. Here is an example:

V/Apptentive: + Parsing Interaction Criteria.
V/Apptentive:   + LogicalClause of type "$and"
V/Apptentive:     + ConditionalClause for query: "code_point/com.apptentive#app#launch/invokes/version_name"
V/Apptentive:       + ConditionalTest: $gte: BigDecimal(1)
V/Apptentive:     + ConditionalClause for query: "interactions/00f51c33b553b54409000000/invokes/version_name"
V/Apptentive:       + ConditionalTest: $eq: BigDecimal(0)
V/Apptentive: + Finished parsing Interaction Criteria.
I/Apptentive: Evaluating Criteria
V/Apptentive:   - <$and>
V/Apptentive:     - code_point/com.apptentive#app#launch/invokes/version_name
V/Apptentive:       - BigDecimal(1) $gte BigDecimal(1)?
V/Apptentive:         - => true
V/Apptentive:     - interactions/00f51c33b553b545c9000056/invokes/version_name
V/Apptentive:       - BigDecimal(0) $eq BigDecimal(5)?
V/Apptentive:         - => false
V/Apptentive:   - <$and>
I/Apptentive: - => false

Each clause in the criteria corresponds to configuration you’ve specified in the Interaction configuration, so you may be able to spot the problem. If not, we are here to help.

Interaction Is Covered

Sometimes, an Interaction is displayed, but then immediately covered by another Activity launched by your app. Since our UI is composed of Activities, you need to make sure you don’t launch another Activity right after you engage an Event if you plan on targeting an Interaction to that Event.

If you see something like this in the logs, but you don’t see an Interaction display, check to make sure you aren’t calling startActivity() right after you call Apptentive.engage().

I/Apptentive: Launching interaction: EnjoymentDialog

This log means that the Ratings Prompt launched. You just need to make sure you aren’t covering it up, and you should be good to go.

App Behaves or Looks Weird After Integrating Apptentive

Sometimes after integrating Apptentive, your will notice an EditText is missing, a password field icon is duplicated, or some other unexpected change happens to a part of your app that is seemingly unrelated to your Apptentive integration.

Most of the time, this is caused by a conflicting support library dependency. Check the Apptentive Integration Reference: Dependencies. It will list the version of the support libraries that the latest release of Apptentive depends on. If your app was using an older version of the support libraries, and Apptentive is using a newer version, then when you add Apptentive to your app gradle will use the version Apptentive depends on instead. This can lead to unexpected behavior, as newer versions of the support libraries often change behavior and break any workarounds you may be using.

You can also check for conflict resolution by running the following gradle command and looking at the output for a specific build variant.

./gradlew :app:dependencies

ProGuard/R8/Obfuscation issues

You may have an obfuscation problem if you’re saying/thinking:

  • “Works in Debug but not Release
  • “When we try updating from the previous version…”
  • “We recently updated Android Studio and…”

Or see any of the following in your codes/logs:

  • java.lang.NoClassDefFoundError
  • java.lang.NoSuchMethodError
  • java.lang.ClassCastException

When you build you project using Android Gradle plugin 3.4.0 or higher, the plugin no longer uses ProGuard to perform compile-time code optimization. Instead, the plugin works with the R8 compiler to handle the following compile-time tasks. If you have any issues with R8 optimization – you can disable it by adding the following line in your gradle.properties file:


Using the SDK Debug Token Feature

By copying a special string of text to your device’s clipboard, you can capture log statements from the Apptentive SDK for debugging purposes.

To begin, visit the API & Development section of the Settings tab in your Apptentive Dashboard. Scroll down to the SDK Debug Token section and click the Generate Debug Token button. You should then copy the token to the clipboard on the device that you want to debug. The next time you launch your app (one that includes SDK version 4.1 or greater), you will be prompted as to whether you would like to capture logs.

Tap the Continue button to start the log capture. When you are finished, return to the home screen and re-launch your app. Then tap the Send Report button, and a report will be attached to an email that you can send to our customer success team.

Updated on August 19, 2020

Was this article helpful?

Related Articles