I want to make some Android applications running in the same process, so I give those apps's AndroidManifest
the same sharedUserId:
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
...
android:sharedUserId="aaa.bbb" >
and assign each apps's application the same process:
< application
...
android:process="com.mytest" >
It works in android 4.4.4
, all the Applications run in the same Process.
But crash happened in android 6.0.1
.
When I run the second app, it crashes due to:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}:
java.lang.ClassNotFoundException: Didn't find class "com.example.myapplication.MainActivity" on path:
DexPathList[[zip file "/data/app/com.example.myapplication-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.myapplication-1/lib/arm, /vendor/lib, /system/lib]]
after the system kill the Process, the second app can run and crashes if I run the first application.
It seem that applications can not run in the same process in the same time and I do not know why.