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

Crash on device orientation #9

Open
shuvashish76 opened this issue Oct 12, 2021 · 2 comments
Open

Crash on device orientation #9

shuvashish76 opened this issue Oct 12, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@shuvashish76
Copy link

Crash logs

FATAL EXCEPTION: main
Process: com.example.spokennumbers, PID: 14528
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.spokennumbers/com.example.spokennumbers.MainActivity}: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.example.spokennumbers.spoken_numbers_ingame_fragment: could not find Fragment constructor
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2781)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2859)
	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4702)
	at android.app.ActivityThread.-wrap18(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1598)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6518)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.example.spokennumbers.spoken_numbers_ingame_fragment: could not find Fragment constructor
	at androidx.fragment.app.Fragment.instantiate(Fragment.java:538)
	at androidx.fragment.app.FragmentContainer.instantiate(FragmentContainer.java:57)
	at androidx.fragment.app.FragmentManagerImpl$6.instantiate(FragmentManagerImpl.java:2851)
	at androidx.fragment.app.FragmentState.instantiate(FragmentState.java:85)
	at androidx.fragment.app.FragmentManagerImpl.restoreSaveState(FragmentManagerImpl.java:2488)
	at androidx.fragment.app.FragmentController.restoreSaveState(FragmentController.java:195)
	at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:288)
	at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:106)
	at com.example.spokennumbers.MainActivity.onCreate(MainActivity.java:50)
	at android.app.Activity.performCreate(Activity.java:7023)
	at android.app.Activity.performCreate(Activity.java:7014)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2734)
	... 10 more
Caused by: java.lang.NoSuchMethodException: <init> []
	at java.lang.Class.getConstructor0(Class.java:2320)
	at java.lang.Class.getConstructor(Class.java:1725)
	at androidx.fragment.app.Fragment.instantiate(Fragment.java:523)
	... 22 more

Crash when change orientation from 👇🏿
Screenshot_2021-10-12-07-54-47
Screenshot_2021-10-12-07-54-37

(for some reason, it doesn't crash when on app main screen)

Thanks🙏🏿

@VivekThazhathattil VivekThazhathattil added the bug Something isn't working label Oct 12, 2021
@VivekThazhathattil
Copy link
Owner

Thank you for reporting. I'll look into it.

VivekThazhathattil added a commit that referenced this issue Oct 12, 2021
…ble-orientation

Fix move back issue #12 and hotfix for #9 by disabling orientation change
@VivekThazhathattil
Copy link
Owner

#13 will serve as a hotfix for this issue, until a better solution is obtained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants