Status Update
Comments
na...@gmail.com <na...@gmail.com> #2
This is probably happening because there are multiple instances of DataStore active. You should consider managing the DataStore as a singleton. See the attached bug for more info.
na...@gmail.com <na...@gmail.com> #3
Hmm... doesn't look to be a duplicate, although similar. It's not happening while setting the primary item, but while running a batch of transactions, of which 2 contain the fragment and the first is removing it from the active set. Error message and location are both different.
il...@google.com <il...@google.com> #4
It is the same root cause.
Feel free to try it out by adding the snapshots repository to the repositories {} block:
allprojects {
repositories {
maven {
url 'https://ci.android.com/builds/submitted/5724286/androidx_snapshot/latest/repository/ '
}
google()
jcenter()
}
}
Then switching your Fragment version to 1.2.0-SNAPSHOT.
If you're still seeing a problem, please include a sample project that reproduces your issue.
Feel free to try it out by adding the snapshots repository to the repositories {} block:
allprojects {
repositories {
maven {
url '
}
google()
jcenter()
}
}
Then switching your Fragment version to 1.2.0-SNAPSHOT.
If you're still seeing a problem, please include a sample project that reproduces your issue.
na...@gmail.com <na...@gmail.com> #5
I'm still seeing the issue after switching to 1.2.0-SNAPSHOT.
I'm not sure how much useful a sample project will be, since it takes many minutes of mashing on the touchscreen to recreate the issue. It might also require a slow device (these are relatively low powered tablets, Quad Cortex A53 1.2GHz, 1GB DDR3).
I'll try to put one together later tonight.
I'm not sure how much useful a sample project will be, since it takes many minutes of mashing on the touchscreen to recreate the issue. It might also require a slow device (these are relatively low powered tablets, Quad Cortex A53 1.2GHz, 1GB DDR3).
I'll try to put one together later tonight.
il...@google.com <il...@google.com>
na...@gmail.com <na...@gmail.com> #6
I can recreate the issue with the attached project. It's basically the generated Tabbed Activity, updated to 1.2.0-SNAPSHOT, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT and increased number of pages.
I reproduce it by putting the tablet in landscape mode and then mash on the tabs until it crashes... it sometimes takes many minutes. In production it also happens on activities without a tab bar but with a seek bar.
I reproduce it by putting the tablet in landscape mode and then mash on the tabs until it crashes... it sometimes takes many minutes. In production it also happens on activities without a tab bar but with a seek bar.
jb...@google.com <jb...@google.com> #7
Are there any particularly tabs that you are jumping between? I am having hard time reproducing this issue.
Also in this app you are using Appcompat 1.2.0-SNAPSHOT, you should try to see if you can reproduce it with the Fragment 1.2.0-SNAPSHOT.
Try adding this dependency to your gradle file and see if you can reproduce:
implementation 'androidx.fragment:fragment:1.2.0-SNAPSHOT'
Also in this app you are using Appcompat 1.2.0-SNAPSHOT, you should try to see if you can reproduce it with the Fragment 1.2.0-SNAPSHOT.
Try adding this dependency to your gradle file and see if you can reproduce:
implementation 'androidx.fragment:fragment:1.2.0-SNAPSHOT'
na...@gmail.com <na...@gmail.com> #8
Spent the day trying to automate it (espresso, background thread, etc.) and couldn't re-create it. Finally I accidentally touched the actual view pager while running a test and it crashed. So the good news is I can get it to pretty reliably crash now. The bad news is after switching to 'androidx.fragment:fragment:1.2.0-SNAPSHOT', I can't reproduce it. So looks like it actually was a dupe and I failed to understand the testing instructions (thought the appcompat & fragment shared a code base).
I'll try adding that to production and see if the issues there persist.
Sorry for wasting your time,
Doug
I'll try adding that to production and see if the issues there persist.
Sorry for wasting your time,
Doug
da...@gmail.com <da...@gmail.com> #9
You may be better off using fragment 1.1.0-rc02 as it'd be more stable than 1.2.0-SNAPSHOT, considering you're pushing to prod.
I have verified that rc02 contains the fix. I experienced issues with 1.2.0 while running my espresso test suite.
I have verified that rc02 contains the fix. I experienced issues with 1.2.0 while running my espresso test suite.
Description
Version used: androidx.fragment:fragment:1.1.0-rc01
Devices/Android versions reproduced on: Various tablets running 5.1.1 and 6.0.1
I believe the issue is that a fragment is part of multiple transactions in the backstack and the first transaction removes it from the active set, then a later transaction tries to update the max lifecycle.
It happens rarely, and is hard to reproduce but I'm getting reports from production couple times a week (dozens of tablets used for 12h a day). I am sometimes able to reproduce it by changing pages quickly. Last time it took me 20 minutes.
java.lang.IllegalArgumentException: Fragment MenuPageFragment{19e94527 (5810b3d2-455c-4f52-ba6d-9bd7f8ff9299)} is not an active fragment of FragmentManager FragmentManager{28355a64 in HostCallbacks{2d9a24cd}}
at androidx.fragment.app.FragmentManagerImpl.setMaxLifecycle(FragmentManagerImpl.java:2826)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:428)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2078)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1868)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1823)
at androidx.fragment.app.FragmentManagerImpl.execSingleAction(FragmentManagerImpl.java:1698)
at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:299)
at androidx.fragment.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:256)
at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1244)
at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1092)
at androidx.viewpager.widget.ViewPager$3.run(ViewPager.java:273)
at androidx.viewpager.widget.ViewPager.completeScroll(ViewPager.java:2005)
at androidx.viewpager.widget.ViewPager.smoothScrollTo(ViewPager.java:974)
at androidx.viewpager.widget.ViewPager.scrollToItem(ViewPager.java:684)
at androidx.viewpager.widget.ViewPager.setCurrentItemInternal(ViewPager.java:670)
at androidx.viewpager.widget.ViewPager.onTouchEvent(ViewPager.java:2263)
at android.view.View.dispatchTouchEvent(View.java:8478)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2399)