geniusmart / LoveUT

samples for Robolectric 3.1.4
http://www.jianshu.com/p/9d988a2f8ff7
175 stars 41 forks source link

运行项目报错 #2

Open zhuzhaolin opened 8 years ago

zhuzhaolin commented 8 years ago

java.lang.NoClassDefFoundError: com/android/internal/os/BackgroundThread

at org.robolectric.shadows.ShadowBackgroundThread.reset(ShadowBackgroundThread.java:19)
at org.robolectric.Shadows.reset(Shadows.java:1607)
at org.robolectric.Robolectric.reset(Robolectric.java:22)
at org.robolectric.internal.ParallelUniverse.resetStaticState(ParallelUniverse.java:43)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:233)
at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:188)
at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:54)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:152)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

Caused by: java.lang.ClassNotFoundException: com.android.internal.os.BackgroundThread at org.robolectric.internal.bytecode.InstrumentingClassLoader.getByteCode(InstrumentingClassLoader.java:168) at org.robolectric.internal.bytecode.InstrumentingClassLoader.findClass(InstrumentingClassLoader.java:123) at org.robolectric.internal.bytecode.InstrumentingClassLoader.loadClass(InstrumentingClassLoader.java:95) ... 24 more

yfxong commented 7 years ago

我也遇到这个问题 暂时无解

zhuzhaolin commented 7 years ago

可能有墙没缓存完成,把原来的删掉翻墙重新下载