Android Robotium NoClassDefFoundError

后端 未结 6 1800
一生所求
一生所求 2021-01-04 09:51

I was just trying to use Robotium in an Android JUnit Test, but the Testing always fails with an error:

java.lang.NoClassDefFoundError: com.jayway.android.robotium.s

6条回答
  •  伪装坚强ぢ
    2021-01-04 10:24

    What I did to fix the bug was :

    • Remove the libraries from the standard Java build path :
    • Right click on the project name > Properties > Java Build Path > tab Libraries > remove everything except the “Android X.X” (2.3.3 in my case) and the “Android Dependencies”
    • Rename the libraries folder from “lib” to “libs”
    • By doing that, all the libraries in the folder “libs” are found by the Android plugin and are added to the “Android Dependencies” item of the project
    • Clean the project (not exactly needed)

    You are good to go !

提交回复
热议问题