1
我使用Evernotes Evernotes的Android作業庫android-job庫計劃作業,一切工作正常,但是,當我想是與Robolecteric運行運行測試用例我得到這個錯誤:Robolectric和
com.evernote.android.job.JobManagerCreateException: All APIs are disabled, cannot schedule any job
at com.evernote.android.job.JobManager.<init>(JobManager.java:184)
at com.evernote.android.job.JobManager.create(JobManager.java:107)
at com.M.MyApp.MyApplication.onCreate(MyApplication.java:63)
at org.robolectric.android.internal.ParallelUniverse.setUpApplicationState(ParallelUniverse.java:137)
at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:290)
at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:203)
at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:109)
基本上它用手一指我的應用程序類的63:
JobManager.create(getApplicationContext()).addJobCreator(new JobMaker());