---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.3
alternate:
  - https://yandex.com/support/appmetrica-io/en/sdk/android/analytics/android-errors.md
  - https://yandex.com/support/appmetrica-io/ru/sdk/android/analytics/android-errors.md
  - https://yandex.com/support/appmetrica-io/zh/sdk/android/analytics/android-errors.md
  - href: https://yandex.com/support/appmetrica-io/zh/sdk/android/analytics/android-errors.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.com/support/appmetrica-io/zh/llms.txt?revision=r21677999
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/appmetrica-io/zh/llms.txt?revision=r21677999

# 错误描述

{% note info "" %}

<!-- source: zh/sdk/_includes/android-logs-help.md -->
如果遇到问题，请考虑[启用日志记录](https://yandex.com/support/appmetrica-io/zh/sdk/android/analytics/android-logs.md)并查看日志。 如果您无法自行解决此问题，[联系支持](https://yandex.com/support/appmetrica-io/zh/troubleshooting/feedback-new.md)并附上使用以下命令导出的日志：

`执行 adb logcat -v time 并将输出追加到 ${PATH_TO_FILE}`
<!-- endsource: zh/sdk/_includes/android-logs-help.md -->

{% endnote %}

以下部分描述了在 Android 上使用 AppMetrica SDK 时可能遇到的常见错误。

## 会话数量没有增加 {#session}

检查你的会话跟踪设置。 要了解更多信息，请参见“跟踪用户活动”。

## 报告中没有事件 {#events}

1. 执行至少10个应用操作以触发事件发送。
这是必要的，因为 AppMetrica 会将事件累积在缓冲区中，并分多部分发送到服务器。

2. 等待10分钟后查看报告。 报告不会立即显示事件。

## 添加库到项目时出错 {#add-in-project}

```java translate=no
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)
```

此错误表示在处理的 DexIndexOverflowException 阶段超出了方法限制。 我们建议检查使用的库——可能它们非常占用资源。 如果无法用轻量级替代方案替换，可以使用[多个DEX文件](https://developer.android.com/tools/building/multidex.html)。 这可能会增加应用程序的加载时间。

## 手动跟踪时用户会话时长无效 {#listen-root}

如果[手动跟踪](https://yandex.com/support/appmetrica-io/zh/sdk/android/analytics/android-listen.md#listen)用户会话的实现有误，可能会导致其时长判断不准确。

如果用户会话时长数据看起来不合理，请确保在用户会话结束时始终调用 `AppMetrica.pauseSession()` 方法。 如果没有调用此方法，库会认为会话处于活动状态，并定期与服务器部分进行数据交换AppMetrica。

我们建议检查会话超时时长。 它由`withSessionTimeout()`方法设置。 超时时间设定了会话在应用程序关闭后仍被视为活跃的时间间隔。

## 库 AppMetrica 消耗大量电量 {#power}

如果库消耗的电量过高，请确保在用户会话结束时始终调用 `AppMetrica.pauseSession()` 方法。 如果没有调用此方法，库会认为会话处于活动状态，并定期与服务器部分进行数据交换AppMetrica。

我们建议检查会话超时时长。 它由`withSessionTimeout()`方法设置。 超时时间设定了会话在应用程序关闭后仍被视为活跃的时间间隔。

## 代码冲突：使用自动收集 Fyber 广告收入数据时 {#fyber-unsupport-adrevenue}

对于Fyber的广告收入数据自动收集不受支持，且在版本 `6.4.0` 到 `7.0.0` 中会导致代码冲突。

如果在你的应用中调用`Interstitial.setInterstitialListener`方法，请从依赖列表中排除`io.appmetrica.analytics:analytics-ad-revenue-fyber-v3`模块，以避免冲突。

## 我的问题没有列出 {#not-found}

如果您的问题未列出，请联系[支持服务](https://yandex.com/support/appmetrica-io/zh/troubleshooting/feedback-new.md)。 请指定以下内容：

1. 显示将 SDK 集成到您的应用中的源代码片段。
2. Application ID 在 AppMetrica 网页界面中。
3. Device ID.

   {% cut "如何获取 Google AID" %}

    1. 在测试设备上安装[AppMetrica](https://play.google.com/store/apps/details?id=ru.yandex.mobile.appmetrica)应用。
    2. 登录并从列表中选择您的应用。
    3. 在左上角点击 ![hum](../../../../_images/hum.png) → **Device**。
    4. Google AID 显示在 **AID** 字段中。 在AppMetrica网页界面中输入它。

       {% note tip %}

       您可以在 AppMetrica 应用中启用归因测试。 为此启用**归因测试**。

       {% endnote %}
       
4. 设备型号和制造商、平台和操作系统版本、AppMetrica SDK 版本。

   {% endcut %}

<!-- source: zh/_includes/feedback-button-3.md -->
如果您没有找到所需答案，可以通过反馈表单提交您的问题。 请尽可能详细地描述问题。 如果可能，请附上截图。

<a href="../troubleshooting/feedback-new">
  <span class="button">联系支持</span>
</a>

<a href="../troubleshooting/feedback-docs">
  <span class="button">为文档提出改进建议</span>
</a>
<!-- endsource: zh/_includes/feedback-button-3.md -->
