Skip to main content

Troubleshooting

SDK Not Initializing

Problem: SDK throws errors or events aren't being sent.

Solution:

  1. Verify API key is not empty
  2. Enable debug logging:
B2MetricAnalyticsConfig(
apiKey = "YOUR_API_KEY",
b2MetricAnalyticsLogLevel = B2MetricAnalyticsLogLevel.DEBUG
)
  1. Check Logcat output:
adb logcat | grep B2Metric

Events Not Appearing

Problem: You're tracking events but don't see them in the dashboard.

Common causes:

  1. Events still in queue — For testing, send events immediately:
B2MetricAnalyticsConfig(
apiKey = "YOUR_API_KEY",
batchSize = 1, // Send immediately
flushIntervalSeconds = 5
)
  1. No internet connection — Events are stored locally when offline and sent when connection is restored.

  2. Wrong API key — Verify you're using the correct API key from the B2Metric dashboard.

Push Notification Tracking Not Working

FCM checklist:

  • google-services.json added to app/ directory
  • Firebase configured in Firebase Console
  • FCM dependency added to build.gradle
  • Service registered in AndroidManifest.xml
  • onNewToken() calls registerPushToken()

HMS checklist:

  • agconnect-services.json added to app/ directory
  • Huawei App ID is correct
  • HMS Core installed on device