Fixed
Status Update
Comments
il...@google.com <il...@google.com>
as...@gmail.com <as...@gmail.com> #3
[Comment deleted]
ju...@gmail.com <ju...@gmail.com> #4
Also of note is the adb error when trying to install bad APK: INSTALL_FAILED_DEXOPT
[Deleted User] <[Deleted User]> #5
load dex files over 5Gb. -> load dex files over 5Mb.
[Deleted User] <[Deleted User]> #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
ro...@gmail.com <ro...@gmail.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.
jd...@gmail.com <jd...@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 (
re...@gmail.com <re...@gmail.com> #9
The option is not documented in --help because it was designed for testing and we're not capable of documenting a reliable way to use it as a workaround of the linearalloc limit.
The linearalloc limit is reached when loading classes. At install time dexopt is loading all classes contained in the dex so it's facing the limit immediately. At execution the limit may be reached after some delay dependending of the usage you have of the packaged classes. If you face it at install time but not at execution, this means you never trigger the loading of some classes. In a real application those never loaded classes should have been shrinked away manually or by Proguard. The exception is when there are different groups of classes in the dex files used in separate process.
About multidex library supported versions I've merged recently a change to try to be clearerhttps://android-review.googlesource.com/#/c/108023/
The summary is that the library should work down to API 4 (Donut), but below ICS applications will probably be hit by the linearalloc limit
The linearalloc limit is reached when loading classes. At install time dexopt is loading all classes contained in the dex so it's facing the limit immediately. At execution the limit may be reached after some delay dependending of the usage you have of the packaged classes. If you face it at install time but not at execution, this means you never trigger the loading of some classes. In a real application those never loaded classes should have been shrinked away manually or by Proguard. The exception is when there are different groups of classes in the dex files used in separate process.
About multidex library supported versions I've merged recently a change to try to be clearer
The summary is that the library should work down to API 4 (Donut), but below ICS applications will probably be hit by the linearalloc limit
je...@gmail.com <je...@gmail.com> #10
for Android studio use:
dexOptions {
additionalParameters = ['--multi-dex', '--set-max-idx-number=40000']
}
dexOptions {
additionalParameters = ['--multi-dex', '--set-max-idx-number=40000']
}
hd...@gmail.com <hd...@gmail.com> #11 Restricted
Restricted
Comment has been deleted.
ba...@gmail.com <ba...@gmail.com> #12
Comment has been deleted.
la...@gmail.com <la...@gmail.com> #14
Hi
sh...@gmail.com <sh...@gmail.com> #15
Fortnit
ap...@google.com <ap...@google.com> #16
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 790ebb8dfa2f0e5ffcfc41d88c2cf04288157e67
Author: Ian Lake <ilake@google.com>
Date: Thu Aug 23 10:50:43 2018
Move Fragment's view lifecycle to stopped
The Fragment's view lifecycle should be stopped
when the Fragment's lifecycle is stopped.
Moves the ON_CREATE event to after onViewStateRestored()
and ON_DESTROY event from onDestroyView()
to performDestroyView() to fully mirror the lifecycle.
Test: new testViewLifecycleInFragmentLifecycle() test
Fixes: 113070421
Change-Id: Id03d664fba627f7aab615b76d3e615496e88d6e2
M fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.java
M fragment/src/main/java/androidx/fragment/app/Fragment.java
https://android-review.googlesource.com/737168
Branch: androidx-master-dev
commit 790ebb8dfa2f0e5ffcfc41d88c2cf04288157e67
Author: Ian Lake <ilake@google.com>
Date: Thu Aug 23 10:50:43 2018
Move Fragment's view lifecycle to stopped
The Fragment's view lifecycle should be stopped
when the Fragment's lifecycle is stopped.
Moves the ON_CREATE event to after onViewStateRestored()
and ON_DESTROY event from onDestroyView()
to performDestroyView() to fully mirror the lifecycle.
Test: new testViewLifecycleInFragmentLifecycle() test
Fixes: 113070421
Change-Id: Id03d664fba627f7aab615b76d3e615496e88d6e2
M fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.java
M fragment/src/main/java/androidx/fragment/app/Fragment.java
Description
Version used: 28.0.0-rc01
Theme used: n/a
Devices/Android versions reproduced on: Pixel 2.0, Android 8.0
The sample app is an simple activity with a ViewPager of fragments for which each fragment is observing "TestLiveData" subclass of LiveData . When an instance of "TestLiveData" is observed with the fragment as its LifecycleOwner both LiveData.onActive()/onIsactive() is triggered if the app is foregrounded and backgrounded. However, if a Fragment.getViewLifecycleOwner() is provided to observe LiveData.onInactive() is never called.
Simply launch the sample app and notice the log output of "onActive()" and then push the app into the background. You will notice that there is no "onInactive" called. It is however called when cycling thru the ViewPager but shouldn't it be called when the app is backgrounded?