2014-11-02 49 views
1

我想在我的項目運行roboelectric(多的Android庫項目)和我不斷收到當我嘗試用一​​個簡單的運行測試項目這個錯誤字符串檢查。Roboelectric了java.lang.RuntimeException:java.lang.reflect.InvocationTargetException

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at org.robolectric.bytecode.RobolectricInternals.newInstanceOf(RobolectricInternals.java:33) at org.robolectric.Robolectric.newInstanceOf(Robolectric.java:348) at org.robolectric.Robolectric.newInstanceOf(Robolectric.java:355) at org.robolectric.shadows.ShadowApplication.registerBroadcastReceivers(ShadowApplication.java:121) at org.robolectric.shadows.ShadowApplication.bind(ShadowApplication.java:110) at org.robolectric.internal.ParallelUniverse.setUpApplicationState(ParallelUniverse.java:136) at org.robolectric.RobolectricTestRunner.setUpApplicationState(RobolectricTestRunner.java:430) at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:236) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:177) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.robolectric.bytecode.RobolectricInternals.newInstanceOf(RobolectricInternals.java:25)

+0

java.lang.NoSuchMethodError:android.util.Log.secD(Ljava /郎/字符串; Ljava /郎/字符串;)庫依賴版本不匹配? – SMA 2014-11-02 07:47:45

+0

謝謝@almasshaikh我明白了。 – chaco 2014-11-02 07:52:51

+0

好吧,我會將其作爲回答發佈,所以如果有人得到相同的答案,他們稍後會參考而不是閱讀評論。 – SMA 2014-11-02 07:54:14

回答

0

java.lang.NoSuchMethodError:android.util.Log.secD(Ljava /朗/字符串; Ljava /朗/字符串;)是你所得到的錯誤。

看來你有庫(依賴)版本不匹配?

相關問題