PojavLauncher
PojavLauncher copied to clipboard
[BUG] Fragment not attached to an activity
Describe the bug
crash after switch to background and back to this application
The log file and images/videos
java.lang.IllegalStateException: Fragment LauncherFragment{2a48067} (699aec01-f10a-448d-b3bf-4658f379ee69)} not attached to an activity.
at androidx.fragment.app.Fragment.requireActivity(Fragment.java:833)
at net.kdt.pojavlaunch.fragments.LauncherFragment.selectValidUrl(LauncherFragment.java:111)
at net.kdt.pojavlaunch.fragments.LauncherFragment.lambda$qaAX4LKUp_DVnoSFl1RtCD1foys(Unknown Source:0)
at net.kdt.pojavlaunch.fragments.-$$Lambda$LauncherFragment$qaAX4LKUp_DVnoSFl1RtCD1foys.run(Unknown Source:2)
at java.lang.Thread.run(Thread.java:923)
Steps To Reproduce
1. start this application
2. login
3. switch to recent activity
4. back
5. crash
Expected Behavior
not crashing
Platform
- Device model: some usual device with aosp 11 like system
- CPU architecture: arm64
- Android version: 11
- PojavLauncher version: ed65bb0
Anything else?
No response
I can see how it can get triggered, I will fix it.
@rhjdvsgsgks Try this build, should be working. https://github.com/PojavLauncherTeam/PojavLauncher/actions/runs/2387238748
Try this build, should be working. https://github.com/PojavLauncherTeam/PojavLauncher/actions/runs/2387238748
the crash dialog not shown anymore, but actually still crashing.
java.lang.IllegalArgumentException: View=DecorView@c2d26f4[PojavLauncherActivity] not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:544)
at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:448)
at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:141)
at android.app.Dialog.dismissDialog(Dialog.java:387)
at android.app.Dialog.dismiss(Dialog.java:369)
at net.kdt.pojavlaunch.BaseLauncherActivity.lambda$null$5$BaseLauncherActivity(BaseLauncherActivity.java:236)
at net.kdt.pojavlaunch.-$$Lambda$BaseLauncherActivity$ka0KTwv84KkTFmkHqN3mc5BOJsc.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7664)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
it happens on the same condition. such as when importing a jre (or install a .jar file). a file picker will shown. after select a file, it will jump back to this application and show the progress of uncompress. in this process the application will crash and back to the screen after login.
and i noticed something in log may also relevant to this
System.out: call to onResume
System.out: call to onResume; E
System.out: call to onResumeFragments
System.out: call to onResumeFragments; E
System.out: call to onPostResume
System.out: call to onPostResume; E
View : requestLayout() improperly called by androidx.appcompat.widget.AppCompatButton{b42d02d VFED..C.. ......ID 0,267-883,501 #7f090063 app:id/btnTab1} during layout: running second layout pass
View : requestLayout() improperly called by androidx.appcompat.widget.AppCompatButton{6ae8962 VFED..C.. ......ID 0,501-883,745 #7f090064 app:id/btnTab2} during layout: running second layout pass
View : requestLayout() improperly called by androidx.appcompat.widget.AppCompatButton{9f88af3 VFED..C.. ......ID 0,745-883,979 #7f090065 app:id/btnTab3} during layout: running second layout pass
View : requestLayout() improperly called by androidx.appcompat.widget.AppCompatButton{41b63b0 VFED..C.. ......ID 0,1827-883,2061 #7f090066 app:id/btnTab4} during layout: running second layout pass
and after go back
LauncherActivity: Destroyed!
PhoneWindow: Previously focused view reported id xx during save, but can't be found during restore.
System.out: call to onResume
System.out: call to onResume; E
System.out: call to onResumeFragments
System.out: call to onResumeFragments; E
System.out: call to onPostResume
System.out: call to onPostResume; E
thanks for the answer. Do you have any android developer options enabled ? It might help me reproduce the crash 😄
thanks for the answer. Do you have any android developer options enabled ? It might help me reproduce the crash smile
no
Noted 👍
fixed in the latest play store build