I tried a lot... and quick solution is to remove android:process=":remote" when developing..
but that's not enough.. try bellow.
- 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'.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp"
android:installLocation="auto">
<application
android:name=".App"
android:allowBackup="true"
android:hardwareAccelerated="@bool/gpu_enabled"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/MyTheme">
<service
android:name=".xxxx.MyService"
android:exported="false"
android:process=":remote">
<intent-filter>
<action android:name="xxxx.test.aaa" />
</intent-filter>
</service>
</application>
- remove android:process=":remote" line from original AndroidManifest.xml
- now you can check like below.