I have about 700 tests to run. When I run them all, it crashed there
"Toolkit error due to process failure." Check logcat device for details. Health check failed: instrumentation failed due to "Process crashed".
after some runtime, about 10 minutes and the ~ 360-370th test completed.
Logcat does not contain information about this failure.
This is applicable when starting from Android Studio, from cmd (on PC and Mac). The device used is Samsung S3 on Android 4.1.1
build.gradle file:
apply plugin: 'com.android.application' android { compileSdkVersion 18 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.xxx.yyy" minSdkVersion 9 targetSdkVersion 18 testApplicationId "com.xxx.zzz" testInstrumentationRunner "android.test.InstrumentationTestRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } packagingOptions { exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } sourceSets { main { jniLibs.srcDirs = ['libs'] } } project.gradle.taskGraph.whenReady { connectedAndroidTestDebug { ignoreFailures = true } } } repositories { // The local cache should be used first mavenLocal() jcenter() mavenCentral() } dependencies { compile 'junit:junit:4.12' compile fileTree(include: '*.jar', dir: 'libs') }
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xxx.yyy" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA.autoFocus" /> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera.autofocus" /> <application android:allowBackup="true" android:largeHeap="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.xxx.yyy.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <meta-data android:name="roboguice.annotations.packages" android:value="com.xxx"/> <meta-data android:name="roboguice.modules" android:value="com.xxx.yyy.MainModule"/> </application> </manifest>
One more thing to add: on the previous code released from my code, this failure will not happen, but I can not find what exactly has changed, caused the failure.
Please help me with this problem, I have been trying to understand it for two weeks.
source share