testing-samples: Error: Test instrumentation process crashed. But there is no /files/ directory
Hi all! I get this error
Test instrumentation process crashed. Check my.long.package.activity#checkQuitDialog.txt for details
But there is no /files folder in /data/data/androidx.test.orchestrator, only /cache and /cache_code. I run test on the Emulator
Prerequisites:
defaultConfig {
...
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments clearPackageData: 'true'
}
...
testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
...
dependencies {
androidTestUtil 'androidx.test:orchestrator:1.1.1'
androidTestImplementation('com.schibsted.spain:barista:2.7.1') {
exclude group: 'com.android.support'
}
// Core library
testImplementation 'androidx.test:core:1.1.0'
androidTestImplementation 'androidx.test:core:1.1.0'
// Assertions
testImplementation 'androidx.test.ext:truth:1.1.0'
androidTestImplementation 'androidx.test.ext:truth:1.1.0'
// JUnit
testImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
// JUnitRunner
testImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test:runner:1.1.1'
// Test helpers for LiveData
testImplementation 'android.arch.core:core-testing:2.0.0'
androidTestImplementation 'android.arch.core:core-testing:2.0.0'
// UI /test
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.1'
implementation 'androidx.test.espresso:espresso-idling-resource:3.1.1'
implementation 'com.jakewharton.espresso:okhttp3-idling-resource:1.0.0'
// Robolectric/Mockito
testImplementation 'org.robolectric:robolectric:4.1'
testImplementation 'org.mockito:mockito-core:2.23.4'
androidTestImplementation("org.mockito:mockito-core:2.23.4")
androidTestImplementation("org.mockito:mockito-android:2.23.4")
// Rest mock
testImplementation "com.squareup.retrofit2:retrofit-mock:$retrofitVersion"
testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.1'
}
Thanks!
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 8
- Comments: 22
If anyone is still struggling with this, commenting out:
// execution 'ANDROIDX_TEST_ORCHESTRATOR'
In the testOptions of the project build.gradle enabled me to see more informative error messages from these tests.
Emulator Android 4.4 works for me
They seem to be found in
/data/user_de/0/androidx.test.orchestrator/files
on my emulator (Android 10) but again as @tsaulic noted the actual files don’t tell you anything either.I’ve noticed that sometimes the files are generated, but they’re not very helpful:
@
/data/user_de/0/androidx.test.orchestrator/files/<your.test.class>#<your.test.name>.txt
note: stripped a bunch of
����
+1
I have the same issue, getting what seems to be somewhat random crashes in various tests when I run the whole androidTest suite. Nothing of value in Logcat nor those files #<xxx>.txt that are mentioned in the output. Have you had any progress on this?