microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
8.93k stars 1.46k forks source link

[iOS] CodePush.restartApp() crash #2539

Closed kr-yeon closed 3 months ago

kr-yeon commented 1 year ago

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

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

kr-yeon commented 1 year ago

[super. bridge reload]; Occurs when running code

sudokatsu commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

anthlasserre commented 1 year ago

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

kr-yeon commented 1 year ago

yeah

2023년 8월 19일 (토) 오전 12:21, Anthony LASSERRE @.***>님이 작성:

@kr-yeon https://github.com/kr-yeon Does this crash happen through your local XCode with a release build?

— Reply to this email directly, view it on GitHub https://github.com/microsoft/react-native-code-push/issues/2539#issuecomment-1684074767, or unsubscribe https://github.com/notifications/unsubscribe-auth/APRSJAEBTSIXME33J2VZGQTXV6B7LANCNFSM6AAAAAAZVO4QFY . You are receiving this because you were mentioned.Message ID: @.***>

anthlasserre commented 1 year ago

@kr-yeon Which MacOS version are you using ?

kr-yeon commented 1 year ago

Ventura 13.4 XCodeVersion is 14.3

2023년 8월 19일 (토) 오전 12:25, Anthony LASSERRE @.***>님이 작성:

@kr-yeon https://github.com/kr-yeon Which MacOS version are you using ?

— Reply to this email directly, view it on GitHub https://github.com/microsoft/react-native-code-push/issues/2539#issuecomment-1684079383, or unsubscribe https://github.com/notifications/unsubscribe-auth/APRSJADGZWVDMQV6GEGHFO3XV6CNNANCNFSM6AAAAAAZVO4QFY . You are receiving this because you were mentioned.Message ID: @.***>

ludwig-pro commented 7 months ago

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

kr-yeon commented 7 months ago

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

iita71737 commented 7 months ago

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

kr-yeon commented 7 months ago

I'm also experiencing that issue only on Android. I thought it might be a problem with the built bundle's asset path, but I removed Codepush first.

2024년 1월 20일 (토) 오후 11:54, DanLin @.***>님이 작성:

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

— Reply to this email directly, view it on GitHub https://github.com/microsoft/react-native-code-push/issues/2539#issuecomment-1902119799, or unsubscribe https://github.com/notifications/unsubscribe-auth/APRSJABFPLDEDE2KE32E3PDYPPLDHAVCNFSM6AAAAAAZVO4QF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBSGEYTSNZZHE . You are receiving this because you were mentioned.Message ID: @.***>

MikhailSuendukov commented 6 months ago

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

krunal-cmyk commented 6 months ago

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

ludwig-pro commented 6 months ago

The best solution is to drop codepush and use expo

vlimag commented 5 months ago

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

Logan-FE commented 1 month ago

any changes for this?

DordeDimitrijev commented 1 month ago

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

nihal-37-37 commented 3 weeks ago

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 commented 3 weeks ago

@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 commented 2 weeks ago

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