Android Studioでインストゥルメンテーションテストを実行するのに苦労しています。
複数のテストケースを実行しようとすると、「テストフレームワークが予期せず終了しました」と表示されます。
...そしてすべてのテストは引き続きエミュレータで実行されますが、Android Studioは結果を返していません。
Logcatはこれを示しています:
...
03-17 11:38:59.236 1699 1719 W ActivityManager: Scheduling restart of crashed service androidx.test.orchestrator/.OrchestratorService in 1000ms
03-17 11:38:59.236 1699 1719 W ActivityManager: Crash of app androidx.test.orchestrator running instrumentation ComponentInfo{androidx.test.orchestrator/androidx.test.orchestrator.AndroidTestOrchestrator}
03-17 11:38:59.236 1699 1721 W zygote : kill(-8537, 9) failed: No such process
03-17 11:38:59.238 1699 13861 W Binder : Outgoing transactions from this process must be FLAG_ONEWAY
03-17 11:38:59.238 1699 13861 W Binder : Java.lang.Throwable
03-17 11:38:59.238 1699 13861 W Binder : at Android.os.BinderProxy.transact(Binder.Java:752)
03-17 11:38:59.238 1699 13861 W Binder : at Android.app.IInstrumentationWatcher$Stub$Proxy.instrumentationFinished(IInstrumentationWatcher.Java:160)
03-17 11:38:59.238 1699 13861 W Binder : at com.Android.server.am.InstrumentationReporter$MyThread.run(InstrumentationReporter.Java:86)
03-17 11:38:59.281 1699 1721 W zygote : kill(-8537, 9) failed: No such process
03-17 11:38:59.323 1699 1721 W zygote : kill(-8537, 9) failed: No such process
03-17 11:38:59.353 13845 13845 W app_process: Unexpected CPU variant for X86 using defaults: x86
03-17 11:38:59.362 1699 1721 W zygote : kill(-8537, 9) failed: No such process
03-17 11:38:59.385 1699 1741 W PackageManager: Code path for androidx.test.orchestrator changing from /data/app/androidx.test.orchestrator-fgDRlA7iNSNiyWm4dLj4hg== to /data/app/androidx.test.orchestrator-6QljegpCqjAHwDuS_O9G9Q==
03-17 11:38:59.385 1699 1741 W PackageManager: Resource path for androidx.test.orchestrator changing from /data/app/androidx.test.orchestrator-fgDRlA7iNSNiyWm4dLj4hg== to /data/app/androidx.test.orchestrator-6QljegpCqjAHwDuS_O9G9Q==
03-17 11:38:59.424 13845 13870 W MessageQueue: Handler (Android.os.Handler) {9320712} sending message to a Handler on a dead thread
03-17 11:38:59.424 13845 13870 W MessageQueue: Java.lang.IllegalStateException: Handler (Android.os.Handler) {9320712} sending message to a Handler on a dead thread
03-17 11:38:59.424 13845 13870 W MessageQueue: at Android.os.MessageQueue.enqueueMessage(MessageQueue.Java:545)
03-17 11:38:59.424 13845 13870 W MessageQueue: at Android.os.Handler.enqueueMessage(Handler.Java:662)
03-17 11:38:59.424 13845 13870 W MessageQueue: at Android.os.Handler.sendMessageAtTime(Handler.Java:631)
03-17 11:38:59.424 13845 13870 W MessageQueue: at Android.os.Handler.sendMessageDelayed(Handler.Java:601)
03-17 11:38:59.424 13845 13870 W MessageQueue: at Android.os.Handler.post(Handler.Java:357)
03-17 11:38:59.424 13845 13870 W MessageQueue: at Android.os.ResultReceiver$MyResultReceiver.send(ResultReceiver.Java:57)
03-17 11:38:59.424 13845 13870 W MessageQueue: at com.Android.internal.os.IResultReceiver$Stub.onTransact(IResultReceiver.Java:58)
03-17 11:38:59.424 13845 13870 W MessageQueue: at Android.os.Binder.execTransact(Binder.Java:697)
03-17 11:38:59.436 13768 13850 W zygote : Long monitor contention with owner firebase-iid-executor (13808) at void Java.lang.AbstractStringBuilder.ensureCapacityInternal(int)(AbstractStringBuilder.Java:124) waiters=0 in Java.util.TimeZone Java.util.TimeZone.getTimeZone(Java.lang.String) for 114ms
03-17 11:38:59.519 13768 13768 W ResourceType: Failure getting entry for 0x7f0c0112 (t=11 e=274) (error -75)
03-17 11:38:59.520 13768 13768 W ResourceType: Failure getting entry for 0x7f0c0113 (t=11 e=275) (error -75)
03-17 11:38:59.608 1571 1809 E : Couldn't opendir /data/app/vmdl185214765.tmp: No such file or directory
03-17 11:38:59.608 1571 1809 E installd: Failed to delete /data/app/vmdl185214765.tmp: No such file or directory
03-17 11:38:59.695 1699 1719 W BroadcastQueue: Background execution not allowed: receiving Intent { act=Android.intent.action.PACKAGE_REMOVED dat=package:androidx.test.orchestrator flg=0x4000010 (has extras) } to com.google.Android.gms/.games.chimera.GamesSystemBroadcastReceiverProxy
03-17 11:38:59.702 1699 1719 W BroadcastQueue: Background execution not allowed: receiving Intent { act=Android.intent.action.PACKAGE_REMOVED dat=package:androidx.test.orchestrator flg=0x4000010 (has extras) } to com.google.Android.gms/.photos.autobackup.PhotosAppUninstalledReceiver
...
私のテストの依存関係:
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.2.0'
androidTestImplementation ('androidx.test.espresso:espresso-contrib:3.2.0') {
exclude module: 'support-compat'
}
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation 'androidx.test:core:1.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestUtil 'androidx.test:orchestrator:1.2.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
Android Studioでインスタントランを無効にするには、「テストフレームワークが予期せず終了しました」と「このプロセスからの発信トランザクションはFLAG_ONEWAYでなければなりません」の両方の参照をいくつか見つけましたが、3.5以降、インスタントランはありません、コード変更の適用に名前が変更され、オフにするオプションが表示されません。
これを進める方法についてのアイデアはありますか?
plsは助けます。
Victor Carbalhoが述べたように、これはAndroid Studio 3.6.1 https://stackoverflow.com/a/60727631/2353939 のバグです。
現在、オーケストレーターを無効にしています。
testOptions {
// execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
dependencies {
// androidTestUtil 'androidx.test:orchestrator:1.2.0'
}