运行 Android 仪器测试时出现重复类警告

use*_*003 13 android android-testing android-studio android-espresso

在 Android Studio (3.5) 中创建新的空活动项目并运行生成的检测测试时,我收到以下警告:

W/zygote: Found duplicate classes, falling back to extracting from APK : /data/app/com.example.myapplication.test-888XseHjUJwZJ8YXwEvomw==/base.apk
W/zygote: NOTE: This wastes RAM and hurts startup performance.
W/zygote: Found duplicated class when checking oat files: 'Ljunit/runner/BaseTestRunner;' in /data/app/com.example.myapplication.test-888XseHjUJwZJ8YXwEvomw==/base.apk and /system/framework/android.test.runner.jar
Run Code Online (Sandbox Code Playgroud)

是什么导致它们?它们可以避免吗?

Mos*_*zan 1

首先确保您拥有最新版本的 IDE,然后您的 IDE 会准确地告诉您哪个类是重复的。尽量避免使用任何重复的类。