-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
Fatal Exception java.lang.RuntimeException: Unable to start activity ComponentInfo Unable to instantiate fragment com.swmansion.rnscreens.n #2164
Comments
Looks like omitted installation steps. |
But this error does not exist on all prod devices. I cannot implement a native solution because I can only use codepush. However, the current steps are given below. public class MainActivity extends ReactActivity {
There is a question that comes to my mind. Will changing this in the route reduce my errors?
/* */ |
Hi @MuazzezA, I agree that's strange, given the information that you're using activity with all installation steps completed. However, we can't spot any issues with this error, while we're completing installation steps ourself. Could you please provide a minimal repro that will show the same error as yours, so that we could investigate this issue further? Also, what devices are you using on production to test your app? |
Dunno man :/ Basically change from JS stack to native one (you can also test on |
Hi, First of all I want to share with you all the outputs I have. these came from Firebase Crashlytics. (changed the application name to app) (info : 83% of crash events for this issue happened in the first 5 seconds of a user's session) I don't get this error, but some of my users do. |
This same error appeared in our logs for the first time yesterday. @MuazzezA did you figure out what's going on? |
@joelbrewer unfortunately. I haven't found any solution. I don't even know where the error is coming from but I'll let you know when I figure it out. |
Most likely it is this line that throws an error, if it's of any help to you. |
@kkafar yes this solution is already in my project but it is not working. i think it is a temporary solution. |
Are there any updates on this error? Facing the same issue. |
I don't have any unfortunately. I want not able to reproduce this crash even once and there is no reproduction provided. Waiting for repro here |
Is there a way, that this bug could actually get fixed for real? Passing null, basically destroy the whole view history. So on rotating my tablet, the app starts in the main-activity and has removed every RN screen. And no, I will also not disable configChanges for rotating, as it will break any fold-able phone or putting the app in split-screen. Edit: https://developer.android.com/reference/android/app/Fragment -> I mean, its since 2018 you are telling people to pass null. Could you actually do it correctly for Android? An empty constructor should work fine and not result in crashing the app. Also I am not even able, to build react-native screens, so I could try to fix that error somehow.. Should it actually work on Mac OS? We need that to be fixed, otherwise people have a horrible usage in fold-able phones and when resizing it on tablets. And I would even try to take a look at it, but I cannot get it to build. |
any update on this. react-native-screens: 3.32.0 |
Taking into account that a minimal reproducible example was not provided and we are not able to reproduce this exact issue on our side, I won't prioritise this issue above any another with actual reproduction. As the library is open source, you can always try to fix the problem yourself (especially that you are able to reproduce it apparently). Reporting a build issue in the form of "it does not work", also won't enable me to provide you with any help. To play around you could either build one of our example apps or just use the library in your project and edit the code directly. I guess the contributing guide might be helpful here 😄 Our libraries are maintained free of charge by a team with a limited number of people involved, but if you are not happy with the current pace of development and need premium support dedicated for your app, please reach out to us by sending an email to [email protected]. |
@kkafar just DONT PASS null. Your setup guide is basically the problem (SINCE 2018, so much for pace..). You not implementing an empty constructor of Fragments breaks the Android lifecylce, which I pointed above. Every fragment has to have an empty constructor. Thats how Android works. I mean, you also have one, where you throw the exception which points to the error from 2018 and the idea of "passing null" to fix it. I will try tomorrow to run react-native screens localy, but my question anyway was, if it should even work on Mac OS or if Mac OS CMake breaks everything, as this is the build error Details
|
🤔 CMake is not macOS specific software in any way, so I'm not sure what do you even mean here. If you want to run If you want to build the library itself on macOS and cross-compile it to a native mobile platform, there should be no problem, as I'm doing this daily. |
@kkafar Ok, so it should work fine on Mac OS... Which version of CMake do you use? And which JDK for the android project? Thanks for the answers :) I have cmake 3.25.2 installed. Using homebrew. Gradle uses JDK 17. |
@devjta CMake 3.22.1 (bundled together with Android Studio), JDK 17, NDK appropriate for RN version, for 0.74 I believe it is 26.1. |
@kkafar
these lines in |
Description
I received this error on real devices and could not find a solution.
Steps to reproduce
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{appName/appName.MainActivity}: androidx.fragment.app.Fragment$j: Unable to instantiate fragment com.swmansion.rnscreens.n: calling Fragment constructor caused an exception
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3815)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3977)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:109)
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:2374)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:344)
at android.app.ActivityThread.main(ActivityThread.java:8249)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)
Snack or a link to a repository
link
Screens version
3.20.0
React Native version
0.71.6
Platforms
Android
JavaScript runtime
None
Workflow
React Native (without Expo)
Architecture
None
Build type
Release mode
Device
Real device
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: