私の Android アプリのApplication
オブジェクトは JNI ライブラリをロードしますが、Robolectric はそれを好まないようです。テストを実行すると、Robolectric が異常終了し、次のスタック トレースが表示されます。
java.lang.UnsatisfiedLinkError: java.lang.Runtime.loadLibrary0(Runtime.java:823) の java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758) の java.library.path に cperryinc-jni がありません.System.loadLibrary(System.java:1045) at com.cperryinc.application.MoolaApplication.(MoolaApplication.java:24) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class. java:169) com.xtremelabs.robolectric.internal.ClassNameResolver.safeClassForName(ClassNameResolver.java:36) で com.xtremelabs.robolectric.internal.ClassNameResolver.resolve(ClassNameResolver.java:15) でcom.xtremelabs.robolectric.ApplicationResolver.resolveApplication(ApplicationResolver.java:28) の .newApplicationInstance(ApplicationResolver.java:71)。com.xtremelabs.robolectric.RobolectricTestRunner.createApplication(RobolectricTestRunner.java:483) com.xtremelabs.robolectric.RobolectricTestRunner.setupApplicationState(RobolectricTestRunner.java:360) com.xtremelabs.robolectric.RobolectricTestRunner.internalBeforeTest(RobolectricTestRunner.java:299) .robolectric.RobolectricTestRunner.methodBlock(RobolectricTestRunner.java:277) org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) org. junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) で org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) で org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) org.junit.runners.ParentRunner で。runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners .ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) at com.intellij. rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:182) で com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62) で sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブ メソッド) でcom.intellij.rt.execution.application.AppMain.main(AppMain.java:120) での sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) org.junit.runner.JUnitCore.run(JUnitCore.java:157) で com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) で com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter) .java:182) で com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62) で sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブ メソッド) で sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java) :39) com.intellij.rt.execution.application.AppMain.main (AppMain.java:120) でjunit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) org.junit.runner.JUnitCore.run(JUnitCore.java:157) で com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) で com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter) .java:182) で com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62) で sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブ メソッド) で sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java) :39) com.intellij.rt.execution.application.AppMain.main (AppMain.java:120) でParentRunner$2.evaluate(ParentRunner.java:184) の org.junit.runners.ParentRunner.run(ParentRunner.java:236) の org.junit.runner.JUnitCore.run(JUnitCore.java:157) の com.intellij。 junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:182) com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter. java:62) で sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブ メソッド) で sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) で com.intellij.rt.execution.application.AppMain.main(AppMain.java: 120)ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at com.intellij. junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:182) com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter. java:62) で sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブ メソッド) で sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) で com.intellij.rt.execution.application.AppMain.main(AppMain.java: 120)junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:182) com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter. java:62) で sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブ メソッド) で sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) で com.intellij.rt.execution.application.AppMain.main(AppMain.java: 120)junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:182) com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter. java:62) で sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブ メソッド) で sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) で com.intellij.rt.execution.application.AppMain.main(AppMain.java: 120)com.intellij.rt.execution.application.AppMain.main (AppMain.java:120) で (NativeMethodAccessorImpl.java:39) を呼び出すcom.intellij.rt.execution.application.AppMain.main (AppMain.java:120) で (NativeMethodAccessorImpl.java:39) を呼び出す
これについて何ができるか正確にはわかりません。回避策に関するアイデアはありますか?