Instrumentation run failed due to 'Process crashed.'

前端 未结 6 1477
感动是毒
感动是毒 2021-02-02 06:12

I wanted to run the following test:

package com.xxx.yyy;

import android.content.Context;
import androidx.test.InstrumentationRegistry;
import androidx.test.runn         


        
6条回答
  •  孤城傲影
    2021-02-02 06:25

    So I had the same symptoms but after making all these changes I found that the following config in my project build.gradle file that was an issue

    buildTypes{
         debug {
            debuggable true
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    

    seems that minifyEnable and shrinkResources are behaving differently after the upgrade to androidx, could have happened earlier but I just realized it now. Commenting out the lines fixed my No Tests Found Issues.

    buildTypes{
         debug {
            debuggable true
            //minifyEnabled true
            //shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    

提交回复
热议问题