简体   繁体   中英

VerifyError in android test-project build tools v17

Since installing v17 of the android build tools I am getting a VerifyError in my test project.

A short description of my project structure:

All jar files exist in my main projects libs folder

The test-project is a project that resides inside my main project

All Instrumentation tests exist in the same package as my activities.

I have one jar that is only needed for the test projects in my libs folder in the test project

Has anyone seen this? Its happening on all my projects since updating. Running the test produces an InstrumentationException: java.lang.VerifyError

x...@android.com made a temporary fix for an issue I reported: http://code.google.com/p/android/issues/detail?id=27608 .

You can try to see if the new anttasks.jar file can fix your problem.

It fixed mine. NoClassDefFoundError when running Instrumentation test with ant

In my case, I have a test project using the library of "robotium". I'd had the same problem, and soleved by following steps,

  1. "Properties > Java Build Path > Libraries", delete "Android Dependencies" in my test project.
  2. "Properties > Java Build Path > Libraries", delete two robotium jar and click "Add JARs" to re-import robotium jar in my test project.
  3. "Properties > Java Build Path > Order and Export", check two checkbok of robotium jar (and othera you want exported.)
  4. Clean my test project.

I think you also solve the problem, Good Luck!

more information

  • How to fix the “NoClassDefFoundError” with ADT 17
  • Dealing with dependencies in Android projects
  • 在我的例子中,首先,在属性 - >构建路径 - >库中添加robotium-solo-2.5,然后将robotium-solo-2.5.jar移动到属性 - >构建路径 - >命令和导出的顶部,最后我解决这个有趣的问题容易...

    “属性> Java构建路径>订单和导出”,并检查要导出的所有引用。

    The way Android deals with dependencies has recently changed . If you are using eclipse, then just remove your jar imports and place them in a "libs"-folder in the project root, and everything will be imported automatically.

    The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

     
    粤ICP备18138465号  © 2020-2024 STACKOOM.COM