-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
App crashes when coming back from another activity with landscape orientation On Android 8.1 #22241
Comments
I have the same problem ,my react native version is 0.56.0 , but my all activity is setted android:screenOrientation="portrait" , so I guess it has something related between React Native and Android 8.1,maybe the orientation has no effect,the crash information is: |
I got 3 crashes too. The information of my environment is:
The crash information is: We haven't been able to reproduce it. It has appeared to some users. |
Same problem. react: 16.0.0 Samsung Galaxy Tab A (2016) (gtaxlwifi), Android 8.1 |
same problem "react": "16.4.1", "react-native": "^0.55.4", devices : MI 8 SE | MI 8 | Mi Note 3 android : 8.1.0 1 java.lang.AssertionError: Pausing an activity that is not the current activity, this is incorrect! Current activity: MainActivity Paused activity: MainActivity |
Hey everyone, this issue has quite a few different stack traces, versions of React Native and devices. Is is possible someone could create a repro which we can use to debug the problem locally? |
@orta how would I do this? |
Hi everyone, I have the same issue:
Environment:Galaxy Note 8: Android version 9 |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Hi @sduqlsc , did you find a solution? |
@truongluong1314520 no, till now, still using above code to fix the orientation. |
Hello, we also get this error on react native 0.59.10. Is there a solution to this problem? |
phone_model: SM-J710F java.lang.AssertionError: Pausing an activity that is not the current activity, this is incorrect! Current activity: MainActivity Paused activity: MainActivity |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Also getting this, with the same trace backs that have been posted here already. |
the issue is still there with react-native 0.59.10 |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
still happening on 0.60.5 |
I am facing this issue in react-native version :0.61.5 |
The same here, just deployed updated app with 0.61.5 react native and facing the same issue across multiple users: |
It's also in react-native version: 0.61.5 |
Привет друзья, спустя долгое время мне удалось исправить данную ошибку. что бы было вот так <activity у меня была проблема из за библиотеки react-native-splash-screen |
Hi friends, after a long time I managed to fix this error. what would it be like this <activity I had a problem due to react-native-splash-screen library |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
It is still happening and was not properly fixed. Could please someone look into it? |
I've the same issue in Anyone could fix it? Or know how to reproduce? |
I have the same problem |
I have the same problem
Probably related to the use react-native-splash-screen |
@showtan001 or @vstatsura |
It's work for me in buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 29
targetSdkVersion = 29
supportLibVersion = "28.0.3" <activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
android:resizeableActivity="true"> |
I have the same issue with 2 different activities. By logging the current activity from the react context, it looks like the react context has the good current activity.
From this code I can verify that the react context is ok before pausing. The error itself happens in |
We had the same issue and it happened only on Android 9 and 10. 97% happened on Android 10. There is no issues with Android 11. |
We are not experiencing this issue on Android 11 but we can reproduce it with the "Layout inspector" method on Android 11. Therefore, I guess Layout Inspector is not the qualified method to reproduce the bug. |
Finally, we mitigated the problem by extending ReactFragment and override onPause function. We did a try-catch for calling super.onPause: Because all crashes happened to activities that will be destroyed, we do not care if there are lifecycle issues with the try-catch. We did not observe any other RN life cycle related crashes or complains with this fix. |
Would you mind sharing a diff/patch for this? 🙏 |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
It's work for me @Override
protected void onPause() {
try {
super.onPause();
mDelegate.onPause();
} catch (Throwable e) {
e.printStackTrace();
}
} It should be noted that: the AssertionError extends Error, catch Exception is no useful. |
This may help this is how I solved this issue without saving state |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
Environment
[skip envinfo]
Description
I have a Reat Native v0.44 Main Activity A which is configured as
portrait
orientation while destination Activity B islandscape
, when AstartActivityForResult
to B and B finished ok with result to pass to A, the App crashed.If using following code to set orientation in B, the problem could be solved temporarily:
below is
styles.xml
:So, i think it has something related between Reat Native and Android 8.1.
The text was updated successfully, but these errors were encountered: