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

[iOS] CodePush.restartApp() crash #2539

Closed
kr-yeon opened this issue Jun 27, 2023 · 24 comments
Closed

[iOS] CodePush.restartApp() crash #2539

kr-yeon opened this issue Jun 27, 2023 · 24 comments

Comments

@kr-yeon
Copy link

kr-yeon commented Jun 27, 2023

Steps to Reproduce

  1. build on testflight
  2. start app
  3. request CodePush.restartApp()

Expected Behavior

What you expected to happen?
Restart Application

Actual Behavior

What actually happens?

  STACK TRACE AND/OR SCREENSHOTS

Shutdown app

Reproducible Demo

Environment

  • react-native-code-push version: 8.0.0
  • react-native version: 0.71.6
  • iOS/Android/Windows version: iOS 16
  • Does this reproduce on a debug build or release build? yes. it is release build.
  • Does this reproduce on a simulator, or only on a physical device? physical device!

(The more info the faster we will be able to address it!)

@kr-yeon
Copy link
Author

kr-yeon commented Jun 27, 2023

[super. bridge reload]; Occurs when running code

@sudokatsu
Copy link

I have this same issue. I've found that the CodePush gets applied most of the time, but requires the user to re-open the app after it crashes. Happens more on Android than iOS for me, but still occasionally on iOS.

@peytonwupeixin
Copy link

I use react-native-code-push version: 8.0.2. I have the same issue, iOS happens more than Android. Is it because Code push currently only supports 0.71 and not yet 0.71.6?

@kr-yeon
Copy link
Author

kr-yeon commented Aug 3, 2023

I use react-native-code-push version: 8.0.2. I have the same issue, iOS happens more than Android. Is it because Code push currently only supports 0.71 and not yet 0.71.6?

I am currently using rn 0.71.11 I updated once but still have the same problem

@ludwig-pro
Copy link

ludwig-pro commented Aug 9, 2023

I have exactly the same problem. at first i suspected reanimated, but after patching it, i still get the bug.

Only in "release", according to sentry tracking, it's a RAM problem:

WatchdogTermination: The OS watchdog terminated your app, possibly because it overused RAM.

I try to replace code-push with react-native-restart and I have the same issue, also reported by other here

I use react-native v0.71.1
reanimated patch for react-native-reanimated 3.1.0 =>

diff --git a/node_modules/react-native-reanimated/ios/LayoutReanimation/REAAnimationsManager.m b/node_modules/react-native-reanimated/ios/LayoutReanimation/REAAnimationsManager.m
index 365ae4f..6290823 100644
--- a/node_modules/react-native-reanimated/ios/LayoutReanimation/REAAnimationsManager.m
+++ b/node_modules/react-native-reanimated/ios/LayoutReanimation/REAAnimationsManager.m
@@ -396,7 +396,7 @@ BOOL REANodeFind(id<RCTComponent> view, int (^block)(id<RCTComponent>))
     return NO;
   }
 
-  BOOL hasExitAnimation = _hasAnimationForTag(view.reactTag, EXITING) || [_exitingViews objectForKey:view.reactTag];
+  BOOL hasExitAnimation = [self hasAnimationForTag:view.reactTag type:EXITING] || [_exitingViews objectForKey:view.reactTag];
   BOOL hasAnimatedChildren = NO;
   shouldRemoveSubviewsWithoutAnimations = shouldRemoveSubviewsWithoutAnimations && !hasExitAnimation;
   NSMutableArray *toBeRemoved = [[NSMutableArray alloc] init];
@@ -521,7 +521,7 @@ BOOL REANodeFind(id<RCTComponent> view, int (^block)(id<RCTComponent>))
 {
   LayoutAnimationType type = before == nil ? ENTERING : LAYOUT;
   NSNumber *viewTag = view.reactTag;
-  if (_hasAnimationForTag(viewTag, type)) {
+  if ([self hasAnimationForTag:viewTag type:type]) {
     REASnapshot *after = [[REASnapshot alloc] init:view];
     if (before == nil) {
       [self onViewCreate:view after:after];
@@ -533,7 +533,7 @@ BOOL REANodeFind(id<RCTComponent> view, int (^block)(id<RCTComponent>))
     [self setNewProps:before.values forView:view];
   }
 
-  if (_hasAnimationForTag(viewTag, SHARED_ELEMENT_TRANSITION)) {
+  if ([self hasAnimationForTag:viewTag type:SHARED_ELEMENT_TRANSITION]) {
     if (type == ENTERING) {
       [_sharedTransitionManager notifyAboutNewView:view];
     } else {
diff --git a/node_modules/react-native-reanimated/src/reanimated2/mappers.ts b/node_modules/react-native-reanimated/src/reanimated2/mappers.ts
index 4e66106..bc8712f 100644
--- a/node_modules/react-native-reanimated/src/reanimated2/mappers.ts
+++ b/node_modules/react-native-reanimated/src/reanimated2/mappers.ts
@@ -80,8 +80,11 @@ export function createMapperRegistry() {
   }
 
   function mapperRun() {
-    processingMappers = true;
     runRequested = false;
+    if (processingMappers) {
+      return;
+    }
+    processingMappers = true;
     if (mappers.size !== sortedMappers.length) {
       updateMappersOrder();
     }

@ludwig-pro
Copy link

BTW I use Xcode_14.3.1.app to build the app

@anthlasserre
Copy link

@kr-yeon Does this crash happen through your local XCode with a release build?

@kr-yeon
Copy link
Author

kr-yeon commented Aug 18, 2023 via email

@anthlasserre
Copy link

@kr-yeon Which MacOS version are you using ?

@kr-yeon
Copy link
Author

kr-yeon commented Aug 18, 2023 via email

@ludwig-pro
Copy link

Should we consider react-native-code-push as deprecated?

@kr-yeon
Copy link
Author

kr-yeon commented Jan 18, 2024

In fact, I excluded CodePush from the project. I don't know if I'm stupid, but I couldn't find the answer.

@iita71737
Copy link

I face the issue on Android , but work on iOS.
Anyone face it on Android too?

@kr-yeon
Copy link
Author

kr-yeon commented Jan 20, 2024 via email

@MikhailSuendukov
Copy link
Contributor

Hi everyone! Could you please confirm what this issue still persist on latest version (8.2.1)?

@krunal-cmyk
Copy link

Any solutions, I am facing with iOS on release app. It crashes after restart

@ludwig-pro
Copy link

The best solution is to drop codepush and use expo

@vlimag
Copy link

vlimag commented Mar 28, 2024

Im facing this same issue with expo-updates as well.

  • "react-native-reanimated": "3.6.2",
  • "react-native": "0.73.4",
  • "expo": "~50.0.11",
  • "expo-updates": "~0.24.11",

@Logan-FE
Copy link

Logan-FE commented Aug 5, 2024

any changes for this?

@DordeDimitrijev
Copy link
Contributor

Hi @Logan-FE thank you for reaching out. Does this issue still reproduce on latest 8.3.1 version?

@nihal-37-37
Copy link

Im facing this same issue with expo-updates as well.

  • "react-native-reanimated": "3.6.2",
  • "react-native": "0.73.4",
  • "expo": "~50.0.11",
  • "expo-updates": "~0.24.11",

@vlimag vlimag you found any alternative or solution with this?

@nihal-37-37
Copy link

nihal-37-37 commented Aug 22, 2024

@DordeDimitrijev I'm facing same problem, distribution is fine but to effect on android application

"react-native-code-push": "^8.3.1",
 "react-native": "0.73.4",

@DmitriyKirakosyan
Copy link
Contributor

@nihal-37-37 , are you using react-native-reanimated in direct or transitive dependencies? Could you share your crash log?

@nainglynndw
Copy link

if you are using react-native-screenshot-prevent , remove enableSecureView and disableSecureView.

Problem happens when we reload jsbundle.

codepush.restart() also reload jsbundle.

These make crash for me.

After remove, it works

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