Instant run doesn't work due to “multiple process”

后端 未结 3 1133

After having configured instant run, the run button has a small yellow thunderbolt.But while I run the app, Android Studio still performed a full build & install, full messa

3条回答
  •  一个人的身影
    2021-02-08 04:55

    I tried a lot... and quick solution is to remove android:process=":remote" when developing..

    but that's not enough.. try bellow.

    1. use Flavors.

    build.gradle(app)

    buildTypes {
        debug {   
            minifyEnabled false
            signingConfig signingConfigs.debug
        }
    
        release {
            minifyEnabled true
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
        development {
            minSdkVersion 21
        }
        production {
            minSdkVersion 14
        } 
    }
    flavorDimensions "default"
    


    Now you have 4 Build Variants
    => developmentDebug, developmentRelease, productionDebug, productionRelease



    developmentDebug, developmentRelease
    => no use multi process

    productionDebug, productionRelease
    => use multi process



    2. copy orginal "AndroidManifest.xml" to YouAppRoot\app\src\production, and then remove all elements except 'service'.

    
    
    
    
    
        
            
                
            
        
    
    

    1. remove android:process=":remote" line from original AndroidManifest.xml

    2. now you can check like below.

提交回复
热议问题