Documentation > Android

Troubleshooting

If you are having trouble integrating the SDK, uploading your certificates or sending notifications, here are some suggestions.

Integration issues

Failed to resolve: com.batch.android:batch-sdk:1.5+ error.

This error is due to a misconfigured build.gradle file. Please take a look at this example to find the error.

Unable to use GCM because the Google Play Services library is not integrated correctly

Please ensure you added the Play Services library in the dependencies. If you use Proguard ("minifyEnabled=true" in the Gradle build), make sure you have added Batch's Proguard rules.

The number of collected tokens is not increasing

If you use Proguard, please make sure you have added Batch's Proguard rules. If your integration worked on the debug builds, it is probably because Proguard was disabled on that configuration.

Batch is not showing the direct open rate of my campaigns

This usually happens when the SDK is not integrated in ALL your activities.

User data editor - Error while applying

Please make sure you call Batch.User methods after Batch.onStart() and before Batch.onStop().

Common issues

Unable to find a start event for [appname]

There are several points you should check if Batch is unable to find a start event for your app:

  • Integration issue: See if Batch is integrated in all your activities.
  • Wrong API key: Make sure you are using a valid API Key (⚙ Settings → General).
  • Emulator. Make sure you are testing on a real device (unless you're using Google API emulators).
  • Logcat: Look for errors in logcat to understand why Batch is not starting in your app.

Unable to find a token for [appname]

If Batch is unable to find a token, here are some suggestions to find the issue:

  • Emulator. Make sure you are testing on a real device since Batch relies on the Play Services for push services (unless you're using Google API emulators).
  • GCM sender ID. Check if you have set the GCM sender ID in your code as described here.
  • Google Play services. See if you are using the most recent version of the Google Play Services by opening this link on your device.

My device doesn't seem to receive any notifications

Here are several points that may help:

  • Network. Try turning off and on your WiFi connection or using a 3G/4G connection.
  • Integration issue. See if Batch is registering a push token in your logs or if there are errors in your device logcat.
  • Force close. Go to the system settings → Apps. Make sure your app is not force closed, otherwise it won't receive any notifications.
  • Energy saving. Some energy saving features may kill the apps (Samsung Smart Manager) or delay push delivery when the device is low on battery (Doze). Try changing the priority of your push to see if that fixes the issue.

You can also check the status of every message sent to a specific device token (received, device disconnected, etc) using the FCM Diagnostics from the Google Play Developer Console.

FCM Diagnostics

I’m not seeing any data on my dashboard

There are several points you should check if Batch doesn't show any data on your dashboard:

  • Dev/Live API key. Make sure that you used the Live API key in the build you uploaded to the store. Stats are only displayed for the Live API key.
  • 24h delay. Installs, DAU, starts and redeems shown on the Analytics tab are updated on a 24h basis for the Live API key.
  • Integration issue. If you still don't see any stats for your app 24h after changing the API key, see if you find anything related to Batch in your logs and double check your integration using the documentation.

Testing issues

Unable to send your test message: GCM did not accept the authorization key

GCM tokens are linked to a single Sender ID. Make sure the GCM Server API Key used in Batch's dashboard (⚙️ Settings → Push settings) matches the GCM sender ID used in your app. You will find more information here.

Error while requesting push token to GCM: SERVICE_NOT_AVAILABLE

This error happens when GCM is not available for a short period of time. Try again later or fallback on cellular network.

Unable to send your test message: Bad Request

Please reach us at support@batch.com. Our team will help you to fix the issue.

GCM/internal errors

You can find the list of GCM and Batch internal errors in the Notifications tab, by hovering on the error count.

gcm_invalid_registration

GCM sends this error when the token Batch tries to push is not valid anymore. This usually happens when users uninstall/reinstall your app.

gcm_mismatch_sender_id

On Android, tokens are linked to a specific sender ID. GCM will systematically send this error when a token is pushed with the wrong sender ID. Make sure you are using the same Sender ID you were using with your old push provider.

max_retry_attempts

This internal error happens when the number of maximum send attempts is reached for a token. Feel free to reach us if you are seeing to many max_retry_attemps errors.

If the number of max_retry_attempts error suddenly increases, make sure you are using a "Server API key" to communicate with GCM (Developer dashboard → Credentials → API keys). If you are using an Android API key, you should generate a new Server API key and paste it in Batch's dashboard (⚙️ Settings → Push settings).