Error descriptions

The following sections describe common errors that you might encounter while working with the AppMetrica SDK on Android.

The number of sessions does not increase

Check your session tracking settings. For more information, see Tracking user activity.

No events in the report

  1. Perform a minimum of 10 app actions that trigger the event sending. It's necessary because AppMetrica accumulates events in the buffer and sends to the server in several parts.

  2. Wait for 10 minutes and check the report. Reports don't display events immediately.

Error adding a library to a project

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)

This error indicates that the method limit was exceeded at the DexIndexOverflowException stage of processing. We recommend reviewing the libraries used — perhaps they are very heavy. If they can't be replaced with lightweight alternatives, you can use multiple DEX files. This might increase the app loading time.

Error initializing AppMetrica with third-party libraries

The code in the Application.onCreate() method runs for all processes. If you encounter an initialization error after integrating a third-party library (such as Firebase Cloud Messaging), make sure that the third-party library is initialized only in the main process.

Error examples:

Unable to create application your.package.name.YourApp: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process your.package.name:Metrica. Make sure to call FirebaseApp.initializeApp(Context) first.
android.database.sqlite.SQLiteException: table httpauth already exists (code 1)
Fatal Exception: java.lang.RuntimeException: Using WebView from more than one process at once with the same data directory is not supported.
ANR at com.google.android.gms.ads.*

To fix the error, implement the main process check before initializing third-party libraries:

class YourApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        if (isMainProcess()) {
            // Initializing third-party libraries after verification.
        }
    }
}
class YourApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate()

        if (isMainProcess()) {
            // Initializing third-party libraries after verification.
        }
    }
}

Note

Implement verification of the main process on your own. See an example in the Stack Overflow answer.

Invalid duration of user session at manual tracking

If the manual tracking of the user session is incorrectly implemented, it may lead to an inaccurate determination of its duration.

If the user session duration data look invalid, make sure the AppMetrica.pauseSession() method is always called when the user session ends. If this method is not called, the library considers that the session is active and commits regular data exchange with the server part of AppMetrica.

We recommend checking the duration of the session timeout. It is set by the withSessionTimeout() method. The timeout sets the time interval during which the session will be considered active even after the application is closed.

High power consumption by the AppMetrica library

If the library is consuming too much power, make sure you always call the AppMetrica.pauseSession() method when the user session ends. If this method is not called, the library considers that the session is active and commits regular data exchange with the server part of AppMetrica.

We recommend checking the duration of the session timeout. It is set by the withSessionTimeout() method. The timeout sets the time interval during which the session will be considered active even after the application is closed.

My problem is not listed

If your problem is not listed, contact support service. Specify the following:

  1. The source code snippet that shows the SDK integration to your app.

  2. Application ID in the AppMetrica web interface.

  3. Device ID.

    1. Install the AppMetrica app on the test device.

    2. Log in and select your app from the list.

    3. In the upper-left corner, click humDevice.

    4. The Google AID is shown in the AID field. Enter it in the AppMetrica web interface.

      Tip

      You can enable attribution testing in the AppMetrica app. Enable Attribution testing for that.

  4. Device model and manufacturer, platform and OS version, AppMetrica SDK version.

If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.

Contact support