reactwg / react-native-releases

React Native Releases Working Group
358 stars 7 forks source link

App builds but closes after splash screen and don't display any helpful logs on logcat #573

Closed lucasGabrielDeAA closed 1 month ago

lucasGabrielDeAA commented 1 month ago

Old Version

0.71.10

New Version

0.75.3

Description

I have a live app which I am upgrading to 0.75.3 version. After following the upgrade guide and, install all the new dependencies and build the app I am facing issues. The app builds with no compiling problems using Android Studio and it launches properly on simulator, but it closes very quickly without displaying any helpful information on LogCat, or displaying any other information on metro-bundler.

Steps to reproduce

  1. Install the app dependencies using yarn install
  2. Build the app using Android Studio

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
  OS: macOS 14.6.1
  CPU: (11) arm64 Apple M3 Pro
  Memory: 76.95 MB / 18.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.14.0
    path: ~/.nvm/versions/node/v20.14.0/bin/node
  Yarn:
    version: 3.6.4
    path: ~/.nvm/versions/node/v20.14.0/bin/yarn
  npm:
    version: 10.7.0
    path: ~/.nvm/versions/node/v20.14.0/bin/npm
  Watchman:
    version: 2024.06.10.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK:
    API Levels:
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 34.0.0
    System Images:
      - android-34 | Google Play ARM 64 v8a
      - android-35 | Google APIs ARM 64 v8a
      - android-35 | Pre-Release 16 KB Page Size Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.15989.150.2411.11948838
  Xcode:
    version: 15.0/15A240d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/lucasgabrieldearaujoassis/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.75.3
    wanted: 0.75.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

Attached here are the errors displayed on LogCat at the moment of the app crash, hope it helps.

SyntaxError: JSON Parse error: Unexpected character: p, js engine: hermes
2024-10-10 19:31:19.767 13917-14076 unknown:ReactNative     com.app_name                   E  Exception in native call from JS
                                                                                                    com.facebook.react.common.JavascriptException: SyntaxError: JSON Parse error: Unexpected character: p, js engine: hermes, stack:
                                                                                                    anonymous@1:791288
                                                                                                    loadModuleImplementation@1:113905
                                                                                                    guardedLoadModule@1:113428
                                                                                                    metroRequire@1:113058
                                                                                                    anonymous@1:791073
                                                                                                    loadModuleImplementation@1:113905
                                                                                                    guardedLoadModule@1:113428
                                                                                                    metroRequire@1:113058
                                                                                                    anonymous@1:789682
                                                                                                    loadModuleImplementation@1:113905
                                                                                                    guardedLoadModule@1:113428
                                                                                                    metroRequire@1:113058
                                                                                                    anonymous@1:788158
                                                                                                    loadModuleImplementation@1:113905
                                                                                                    guardedLoadModule@1:113428
                                                                                                    metroRequire@1:113058
                                                                                                    anonymous@1:785520
                                                                                                    loadModuleImplementation@1:113905
                                                                                                    guardedLoadModule@1:113428
                                                                                                    metroRequire@1:113058
                                                                                                    anonymous@1:784782
                                                                                                    loadModuleImplementation@1:113905
                                                                                                    guardedLoadModule@1:113428
                                                                                                    metroRequire@1:113058
                                                                                                    anonymous@1:777262
                                                                                                    loadModuleImplementation@1:113905
                                                                                                    guardedLoadModule@1:113428
                                                                                                    metroRequire@1:113058
                                                                                                    anonymous@1:763733
                                                                                                    loadModuleImplementation@1:113905
                                                                                                    guardedLoadModule@1:113428
                                                                                                    metroRequire@1:113058
                                                                                                    anonymous@1:734500
                                                                                                    loadModuleImplementation@1:113905
                                                                                                    guardedLoadModule@1:113428
                                                                                                    metroRequire@1:113058
                                                                                                    anonymous@1:119788
                                                                                                    loadModuleImplementation@1:113905
                                                                                                    guardedLoadModule@1:113385
                                                                                                    metroRequire@1:113058
                                                                                                    global@1:112586

                                                                                                        at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:65)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
                                                                                                        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:146)
                                                                                                        at com.facebook.jni.NativeRunnable.run(Native Method)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:958)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                        at android.os.Looper.loop(Looper.java:294)
                                                                                                        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:235)
                                                                                                        at java.lang.Thread.run(Thread.java:1012)

Failed to fetch suggestions from AppSearch, fallback to AGA
                                                                                                    java.util.concurrent.CompletionException: java.util.NoSuchElementException: No value present
                                                                                                        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:308)
                                                                                                        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:323)
                                                                                                        at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:684)
                                                                                                        at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:486)
                                                                                                        at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2138)
                                                                                                        at com.google.android.apps.nexuslauncher.allapps.H0.onResult(Unknown Source:59)
                                                                                                        at android.app.appsearch.SearchSessionUtil$1.lambda$onResult$0(SearchSessionUtil.java:129)
                                                                                                        at android.app.appsearch.SearchSessionUtil$1.$r8$lambda$_nlk9WiPjSfaAsqKYmp0aPvSRC0(SearchSessionUtil.java:1)
                                                                                                        at android.app.appsearch.SearchSessionUtil$1$$ExternalSyntheticLambda0.run(R8$$SyntheticClass:13)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:958)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                        at android.os.Looper.loop(Looper.java:294)
                                                                                                        at android.os.HandlerThread.run(HandlerThread.java:67)
                                                                                                    Caused by: java.util.NoSuchElementException: No value present
                                                                                                        at java.util.Optional.get(Optional.java:144)
                                                                                                        at com.google.android.apps.nexuslauncher.allapps.H0.onResult(Unknown Source:16)
                                                                                                        at android.app.appsearch.SearchSessionUtil$1.lambda$onResult$0(SearchSessionUtil.java:129) 
                                                                                                        at android.app.appsearch.SearchSessionUtil$1.$r8$lambda$_nlk9WiPjSfaAsqKYmp0aPvSRC0(SearchSessionUtil.java:1) 
                                                                                                        at android.app.appsearch.SearchSessionUtil$1$$ExternalSyntheticLambda0.run(R8$$SyntheticClass:13) 
                                                                                                        at android.os.Handler.handleCallback(Handler.java:958) 
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                                                        at android.os.Looper.loopOnce(Looper.java:205) 
                                                                                                        at android.os.Looper.loop(Looper.java:294) 
                                                                                                        at android.os.HandlerThread.run(HandlerThread.java:67) 

Trace auth_account_base-GcmTaskChimeraService_onRunTaskAsync timed out after 2770247 ms. Complete trace: # esgh@f9c3c73d
                                                                                                    esgn: 
                                                                                                        at tk_trace.MainThreadWork(Started After:0)
                                                                                                        at tk_trace.checkQueueEagerly(Started After:0)
                                                                                                        at tk_trace.trigger_EXECUTION_CALLBACK(Started After:0)
                                                                                                        at tk_trace.scheduler-StandaloneSchedulingEngine_handleClientCallback(Started After:0)
                                                                                                        at tk_trace.ScheduledTaskImpl(Started After:0)
                                                                                                        at tk_trace.auth_account_base-GcmTaskChimeraService_onRunTaskAsync(Started After:0)
2024-10-10 19:31:31.294  1291-14058 esfr                    com.google.android.gms.persistent    E  Trace clearcut-QosUploaderChimeraService_onRunTaskAsync timed out after 2770230 ms. Complete trace: # esgh@87f4e400
                                                                                                    esgn: 
                                                                                                        at tk_trace.Flogger:INFO:218:Task %s/%s started execution. cause:%s exec_start_elapsed_seconds: %s(Started After:1)
                                                                                                        at tk_trace.checkQueueEagerly(Started After:1)
                                                                                                        at tk_trace.trigger_EXECUTION_CALLBACK(Started After:1)
                                                                                                        at tk_trace.scheduler-StandaloneSchedulingEngine_handleClientCallback(Started After:1)
                                                                                                        at tk_trace.ScheduledTaskImpl(Started After:0)
                                                                                                        at tk_trace.clearcut-QosUploaderChimeraService_onRunTaskAsync(Started After:0)
2024-10-10 19:31:31.294  1291-14058 esfr                    com.google.android.gms.persistent    E  Trace scheduler-StandaloneSchedulingEngine_handleClientCallback timed out after 3318547 ms. Complete trace: # esgh@dc2433d0
                                                                                                    esgn: 
                                                                                                        at tk_trace.BinderCall_android.os.IPowerManager#releaseWakeLock(Started After:0)
                                                                                                        at tk_trace.trigger_EXECUTION_CALLBACK(Started After:0)
                                                                                                        at tk_trace.scheduler-StandaloneSchedulingEngine_handleClientCallback(Started After:0)
2024-10-10 19:31:31.295  1291-14058 esfr                    com.google.android.gms.persistent    E  Trace clearcut-QosUploaderChimeraService_onRunTaskAsync timed out after 2770187 ms. Complete trace: # esgh@cd8ae1ad
                                                                                                    esgn: 
                                                                                                        at tk_trace.BinderCall_android.app.IAlarmManager#set(Started After:1)
                                                                                                        at tk_trace.checkQueueEagerly(Started After:1)
                                                                                                        at tk_trace.trigger_EXECUTION_CALLBACK(Started After:1)
                                                                                                        at tk_trace.scheduler-StandaloneSchedulingEngine_handleClientCallback(Started After:1)
                                                                                                        at tk_trace.ScheduledTaskImpl(Started After:0)
                                                                                                        at tk_trace.clearcut-QosUploaderChimeraService_onRunTaskAsync(Started After:0)
2024-10-10 19:31:31.305  1291-14058 esfr                    com.google.android.gms.persistent    E  Trace scheduler-StandaloneSchedulingEngine_handleClientCallback timed out after 3318591 ms. Complete trace: # esgh@9e2833d0
                                                                                                    esgn: 
                                                                                                        at tk_trace.Flogger:INFO:218:Task %s/%s started execution. cause:%s exec_start_elapsed_seconds: %s(Started After:0)
                                                                                                        at tk_trace.checkQueueEagerly(Started After:0)
                                                                                                        at tk_trace.trigger_EXECUTION_CALLBACK(Started After:0)
                                                                                                        at tk_trace.scheduler-StandaloneSchedulingEngine_handleClientCallback(Started After:0)

Reproducer

Unable to share any repository for this

Screenshots and Videos

No response

cortinico commented 1 month ago

com.facebook.react.common.JavascriptException: SyntaxError: JSON Parse error: Unexpected character: p, js engine: hermes, stack:

It seems like is failing to parse the JSON somewhere.

Anyway, we can't help without a reproducer of any sort.

cortinico commented 1 month ago

We're closing all the "Type: Upgrade Issue" in this repo as we're using it only for pick requests.

If you're still having this problem, please open an issue on: https://github.com/facebook/react-native/issues/new