Status Update
Comments
vi...@google.com <vi...@google.com> #2
NOTE: It DOES NOT happen if not using support package, but use android level 14/15 library. I believe Honeycomb works well too.
My current workaround is to provide my own DialogFragment.show() method, like below:
public int show(FragmentTransaction transaction, String tag) {
return show(transaction, tag, false);
}
public int show(FragmentTransaction transaction, String tag, boolean allowStateLoss) {
transaction.add(this, tag);
mRemoved = false;
mBackStackId = allowStateLoss ? transaction.commitAllowingStateLoss() : transaction.commit();
return mBackStackId;
}
do...@traveloka.com <do...@traveloka.com> #3
vi...@google.com <vi...@google.com> #4
It happens with both Support Package v4 r6 and v13 r6.
ma...@google.com <ma...@google.com> #5
As a workaround I use a boolean in the onActivityResult to mark the desired dialog and show the dialog in the onResume.
r....@gmail.com <r....@gmail.com> #7
Try moving your commits into "onPostResume()" instead as described here:
ra...@bigsteptech.com <ra...@bigsteptech.com> #8
vi...@google.com <vi...@google.com> #9
Let's say we have an application where we need to select a picture from gallery, and then when we come back to onActivityResult(), we need to show a DialogFragment asking the user if he really wants to send the file.
How do you propose we can implement this with the current API?
Thank you,
Sabin
do...@traveloka.com <do...@traveloka.com> #10
dismissAllowingStateLoss() is the least resort for dismiss() dialog in onPostExecute(), but there is no solution for DialogFragment#show() in onPreExecute() callback.
vi...@google.com <vi...@google.com> #11
How could it be? And, how can I solve this?
kr...@theporter.in <kr...@theporter.in> #12
sh...@airasia.com <sh...@airasia.com> #13
FragmentTransaction ft = manager.beginTransaction();
ft.add(this, tag);
ft.commitAllowingStateLoss();
}
I looked up the source code and got this method. I'm wondering why Google add a @hide annotation to this great API?
do...@traveloka.com <do...@traveloka.com> #14
gg...@google.com <gg...@google.com> #15
getFragmentManager().beginTransaction()
.add(fragment, tag)
.commitAllowingStateLoss();
do...@traveloka.com <do...@traveloka.com> #16
This error happened to my app users..
Please refer to below logs.
Samsung Galaxy Note10+ 5G (d2x), Android 9
java.lang.IllegalStateException:
at androidx.fragment.app.FragmentManager.checkStateLoss (FragmentManager.java:1997)
at androidx.fragment.app.FragmentManager.enqueueAction (FragmentManager.java:2029)
at androidx.fragment.app.BackStackRecord.commitInternal (BackStackRecord.java:321)
at androidx.fragment.app.BackStackRecord.commit (BackStackRecord.java:286)
at androidx.fragment.app.DialogFragment.show (DialogFragment.java:156)
at com.xxx.yyyyy.ZZZActivity$8$1.run (ZZZActivity.java:585)
at android.os.Handler.handleCallback (Handler.java:873)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loop (Looper.java:216)
at android.app.ActivityThread.main (ActivityThread.java:7263)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:975)
gg...@google.com <gg...@google.com> #17
@
Thanks
do...@traveloka.com <do...@traveloka.com> #18
our app no longer using baseline profile but issue still not resolved.
vi...@google.com <vi...@google.com> #19
Thanks for reporting this issue.
Try to avoid having a big one APK, but use splits to reduce the load of the first base APK load
ri...@adobe.com <ri...@adobe.com> #20
Hi, even we are facing this issue. This ANR is getting reported on Application launch with the below stack-trace on Android 11 - Oppo devices.
Stack trace :
#00 pc 0x1f120 libdexfile.so (art::DexFile::FindClassDef(art::dex::TypeIndex) const + 48)
#01 pc 0x2efd0 libdexfile.so (art::dex::DexFileVerifier::CheckInterClassDefItem() + 1096)
#02 pc 0x304fc libdexfile.so (art::dex::DexFileVerifier::CheckInterSectionIterate(unsigned long, unsigned int, art::DexFile::MapItemType) + 364)
#03 pc 0x3076c libdexfile.so (art::dex::DexFileVerifier::CheckInterSection() + 268)
#04 pc 0x308e8 libdexfile.so (art::dex::DexFileVerifier::Verify() + 192)
#05 pc 0x31100 libdexfile.so (art::dex::Verify(art::DexFile const*, unsigned char const*, unsigned long, char const*, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) + 160)
#06 pc 0x238bc libdexfile.so (art::DexFileLoader::OpenCommon(unsigned char const, unsigned long, unsigned char const*, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, art::OatDexFile const*, bool, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::unique_ptr<art::DexFileContainer, std::__1::default_delete
Our current AGP version is 8.4.1 Is this issue fixed in the latter AGP versions ? Do we need to update our gradle version ? Can you please confirm if there is a fix in pipeline for the same ?
Thanks, Ritika Jain.
Description
From play console we got significant amount of ANR from art::DexFile::FindClassDef. This only happen on Android 11, 98% on OPPO device. This is new issue after we enabled baseline profile and app startup profiles, not sure if it related or not. I am not sure how to repro this because we dont have the device. Please find attachment below for stacktrace.