gpt4 book ai didi

java - Android单元测试: Instrumentation failed due to a class error

转载 作者:行者123 更新时间:2023-12-01 15:42:46 24 4
gpt4 key购买 nike

我正在 Android 模拟器上使用 Robotium 运行测试。当我运行测试时,我收到一条错误消息“测试未能运行完成。原因:仪器因

而失败”
 com.example.android.businesslogic.TestBL$1

我检查 logcat 是否有错误,并看到以下内容

 W/ActivityManager( 51) com.example.android.businesslogic.TestBL$1
W/ActivityManager( 51) java.lang.NoClassDefFoundError: com.example.android.businesslogic.TestBL$1

我的应用程序没有错误并且可以顺利运行,只是当我进行单元测试时我才遇到这个问题。非常感谢任何帮助。

最佳答案

删除并使用正确的类路径和 apk 路径再次创建测试项目。您只需创建一个测试项目并包含任何外部 Jar(如果有)。这对我有用。

关于java - Android单元测试: Instrumentation failed due to a class error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7760702/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com