Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,大佬,登陆成功会后崩溃 #20

Open
wcglws opened this issue Sep 3, 2022 · 3 comments
Open

你好,大佬,登陆成功会后崩溃 #20

wcglws opened this issue Sep 3, 2022 · 3 comments

Comments

@wcglws
Copy link

wcglws commented Sep 3, 2022

第一个崩溃
Caused by: android.view.InflateException: Binary XML file line #36 in com.netease.music:layout/activity_main: Binary XML file line #36 in com.netease.music:layout/activity_main: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #36 in com.netease.music:layout/activity_main: Error inflating class fragment
Caused by: java.lang.IllegalStateException: Can't access the Fragment View's LifecycleOwner when getView() is null i.e., before onCreateView() or after onDestroyView()
at androidx.fragment.app.Fragment.getViewLifecycleOwner(Fragment.java:361)
at com.netease.music.ui.page.drawer.DrawerFragment.onCreate(DrawerFragment.java:53)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2949)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:278)

第二个
java.lang.IllegalStateException: Can't access the Fragment View's LifecycleOwner when getView() is null i.e., before onCreateView() or after onDestroyView()
at androidx.fragment.app.Fragment.getViewLifecycleOwner(Fragment.java:361)
at com.netease.music.ui.page.mine.MineFragment.onCreate(MineFragment.java:38)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2949)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:278)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)

@zion223
Copy link
Owner

zion223 commented Sep 5, 2022

手机机型和Android版本麻烦告知一下

@wcglws
Copy link
Author

wcglws commented Sep 6, 2022

AndroidStudio模拟器 API31
image

@SherlockGougou
Copy link

把所有 Fragment 中的onCreate换成 onViewCreated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants