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: com.swmansion.rnscreens.ScreenFragment.<init> #2394

Closed
tkphan2804 opened this issue Oct 8, 2024 · 2 comments
Closed

crash: com.swmansion.rnscreens.ScreenFragment.<init> #2394

tkphan2804 opened this issue Oct 8, 2024 · 2 comments
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android

Comments

@tkphan2804
Copy link

Description

I have an app on CHPlay, it's built by react native.
It's crashed on production.
Below is the crash's details:

Type: java.lang.RuntimeException

Exception java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:4184)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:4340)
at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2584)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:226)
at android.os.Looper.loop (Looper.java:313)
at android.app.ActivityThread.main (ActivityThread.java:8810)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)
Caused by androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.swmansion.rnscreens.ScreenFragment: calling Fragment constructor caused an exception
at androidx.fragment.app.Fragment.instantiate (Fragment.java:631)
at androidx.fragment.app.FragmentContainer.instantiate (FragmentContainer.java:57)
at androidx.fragment.app.FragmentManager$3.instantiate (FragmentManager.java:483)
at androidx.fragment.app.FragmentStateManager. (FragmentStateManager.java:85)
at androidx.fragment.app.FragmentManager.restoreSaveState (FragmentManager.java:2728)
at androidx.fragment.app.FragmentController.restoreSaveState (FragmentController.java:198)
at androidx.fragment.app.FragmentActivity$2.onContextAvailable (FragmentActivity.java:149)
at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable (ContextAwareHelper.java:99)
at androidx.activity.ComponentActivity.onCreate (ComponentActivity.java:322)
at androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java:273)
at com.facebook.react.ReactActivity.onCreate (ReactActivity.java:45)
at com.yardapp.MainActivity.onCreate (MainActivity.java:43)
at android.app.Activity.performCreate (Activity.java:8657)
at android.app.Activity.performCreate (Activity.java:8636)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1417)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:4165)
Caused by java.lang.reflect.InvocationTargetException:
at java.lang.reflect.Constructor.newInstance0
at java.lang.reflect.Constructor.newInstance (Constructor.java:343)
at androidx.fragment.app.Fragment.instantiate (Fragment.java:613)
Caused by java.lang.IllegalStateException: Screen fragments should never be restored. Follow instructions from #17 (comment)<US_SOCIAL_SECURITY_NUMBER> to properly configure your main activity.
at com.swmansion.rnscreens.ScreenFragment. (ScreenFragment.kt:54)

Steps to reproduce

It's crashed on production.

Snack or a link to a repository

https://github.com/tkphan2804?tab=repositories

Screens version

3.20.0

React Native version

0.71.6

Platforms

Android

JavaScript runtime

None

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Real device

Device model

Galaxy Tab Active3 (Android 13)

Acknowledgements

Yes

@github-actions github-actions bot added the Missing repro This issue need minimum repro scenario label Oct 8, 2024
Copy link

github-actions bot commented Oct 8, 2024

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@github-actions github-actions bot added the Platform: Android This issue is specific to Android label Oct 8, 2024
@kkafar
Copy link
Member

kkafar commented Oct 8, 2024

Hey @tkphan2804, the issue you reported is discussed across many issues in this repository, hence I'll close this as a duplicate and point you to other discussion points.

If you take a look into the stacktrace you provided, you can see reference to #17, which is the initial issue on this topic.
The most recent discussion is in #2342, while you can find many more similar throughout the issues section.

@kkafar kkafar closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

2 participants