Fixed
Status Update
Comments
[Deleted User] <[Deleted User]> #2
[Comment deleted]
[Deleted User] <[Deleted User]> #4
Also of note is the adb error when trying to install bad APK: INSTALL_FAILED_DEXOPT
ar...@google.com <ar...@google.com> #5
load dex files over 5Gb. -> load dex files over 5Mb.
dn...@google.com <dn...@google.com> #6
Same here! Looking forward to a solution :)
Android Studio version: 0.8.12
buildToolsVersion 21.0.1
Gradle 1.11
Android Studio version: 0.8.12
buildToolsVersion 21.0.1
Gradle 1.11
ar...@google.com <ar...@google.com> #7
There is already an option in dx allowing to force generation of smaller dex files:
--set-max-idx-number=<value>
Unfortunately changing the default is not a solution since the linearAlloc limit can be reached at very different levels depending on the classes hierarchy and other criteria.
In addition for most applications, moving to multidex will only help to workaround the linearalloc limit for the installation. But the application will still crash against the same limit at execution. The only working use case where I know multidex can help with linearalloc is when the apk does not contains one application but distinct pieces running in separate process.
--set-max-idx-number=<value>
Unfortunately changing the default is not a solution since the linearAlloc limit can be reached at very different levels depending on the classes hierarchy and other criteria.
In addition for most applications, moving to multidex will only help to workaround the linearalloc limit for the installation. But the application will still crash against the same limit at execution. The only working use case where I know multidex can help with linearalloc is when the apk does not contains one application but distinct pieces running in separate process.
ve...@gmail.com <ve...@gmail.com> #8
Thanks for your quick response.
It's nice to know about that command line option. I do not see it in the output of 'dx --help', might be good to add that.
I'm not very familiar with the 'linearAlloc limit' issue outside of the context of the dexopt step. My sample app is able to run once the lower idx value is set, although I do not actually call into any of the library code that is bundled with the app. I assume it's undefined when/if the 'linearAlloc limit' will be hit in a large application on gb.
I'm a bit confused as to the platform compatibility of multidex given the 'linearAlloc limit' bug. What specific versions of Android are supported? The multidex code implies back to v4 (https://android.googlesource.com/platform/frameworks/multidex/+/master/library/src/android/support/multidex/MultiDex.java ) but it would seem that ICS is the earliest supported platform. Is this correct?
It's nice to know about that command line option. I do not see it in the output of 'dx --help', might be good to add that.
I'm not very familiar with the 'linearAlloc limit' issue outside of the context of the dexopt step. My sample app is able to run once the lower idx value is set, although I do not actually call into any of the library code that is bundled with the app. I assume it's undefined when/if the 'linearAlloc limit' will be hit in a large application on gb.
I'm a bit confused as to the platform compatibility of multidex given the 'linearAlloc limit' bug. What specific versions of Android are supported? The multidex code implies back to v4 (
Description
Android: 7.1.2 beta, 7.0
Replication condition:
1. The app A implements MediaBrowserServiceCompat#onSearch.
2. The app B implements calling MediaBrowserCompat#search and its callback.
3. The app A allows B to access A's MediaBrowserServiceCompat.
4. After calling MediaBrowserCompat#search from B and receive a result, BadParcelableException is thrown and app B crashes.
StackTrace in the logcat:
Parcel: Class not found when unmarshalling: android.support.v4.media.MediaBrowserCompat$MediaItem
java.lang.ClassNotFoundException: android.support.v4.media.MediaBrowserCompat$MediaItem
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at android.os.Parcel.readParcelableCreator(Parcel.java:2507)
at android.os.Parcel.readParcelable(Parcel.java:2461)
at android.os.Parcel.readParcelableArray(Parcel.java:2569)
at android.os.Parcel.readValue(Parcel.java:2418)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2717)
at android.os.BaseBundle.unparcel(BaseBundle.java:269)
at android.os.BaseBundle.containsKey(BaseBundle.java:341)
at android.support.v4.media.MediaBrowserCompat$SearchResultReceiver.onReceiveResult(MediaBrowserCompat.java:1997)
at android.support.v4.os.ResultReceiver$MyRunnable.run(ResultReceiver.java:60)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6209)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.ClassNotFoundException: android.support.v4.media.MediaBrowserCompat$MediaItem
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:1346)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:1406)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at android.os.Parcel.readParcelableCreator(Parcel.java:2507)
at android.os.Parcel.readParcelable(Parcel.java:2461)
at android.os.Parcel.readParcelableArray(Parcel.java:2569)
at android.os.Parcel.readValue(Parcel.java:2418)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2717)
at android.os.BaseBundle.unparcel(BaseBundle.java:269)
at android.os.BaseBundle.containsKey(BaseBundle.java:341)
at android.support.v4.media.MediaBrowserCompat$SearchResultReceiver.onReceiveResult(MediaBrowserCompat.java:1997)
at android.support.v4.os.ResultReceiver$MyRunnable.run(ResultReceiver.java:60)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6209)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
AndroidRuntime: Shutting down VM
03-23 17:58:40.531 24380-24380/com.drivemode.mb_poc E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.drivemode.mb_poc, PID: 24380
android.os.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.v4.media.MediaBrowserCompat$MediaItem
at android.os.Parcel.readParcelableCreator(Parcel.java:2535)
at android.os.Parcel.readParcelable(Parcel.java:2461)
at android.os.Parcel.readParcelableArray(Parcel.java:2569)
at android.os.Parcel.readValue(Parcel.java:2418)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2717)
at android.os.BaseBundle.unparcel(BaseBundle.java:269)
at android.os.BaseBundle.containsKey(BaseBundle.java:341)
at android.support.v4.media.MediaBrowserCompat$SearchResultReceiver.onReceiveResult(MediaBrowserCompat.java:1997)
at android.support.v4.os.ResultReceiver$MyRunnable.run(ResultReceiver.java:60)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6209)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Other comments:
1. MediaBrowserCompat#search works when calling it from app A(same app implementing MediaBrowserServiceCompat)