facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.39k stars 24.36k forks source link

Important! App was working fine for the past months, and now throws random erros #47753

Open GenGraphic opened 2 days ago

GenGraphic commented 2 days ago

Description

We are working on this app for the past year and worked fine until now. We developed it for the first 6 months on IOS with Expo go, and after that droped it and used bare workflow and Android Emulator for the next 6 months. It was working fine until 2 days ago, where we noticed random erros of stuff we worked daily with. I also mention that we worked daily on this app and this problems were not present before. Some exemple was with react-native-gifted-charts, we have it in since begining and worked fine. But 2 days we noticed that the app crashes when the chart loads. After we updated the library, the chart worked again. Now the @gorhom/bottom-sheet crash the app when the modal is closed, this library was also one of the first intalled and we use id in multiple places. We have in the Registration process more screen that have an input field on the center of the page and a next button on the bottom of the page. We testet the Registration procees over 100 times and this problem was not present. I also noticed that there is no console.log visible in my terminal. This is critical so please help me solve this, because the app needs to be deployed asap. We managed to deploy ot on IOS with an older version, and there seems to work fine.

One of the possible reason can be that we changed the bundle id on android, but the app build successfully, so i don't see this beeing the problem.

Thank you!

Steps to reproduce

  1. Chnage Bundle ID in app/build.gradle
  2. Change Bundle ID app/src/main/AndoirdManifes.xml
  3. Change Bundle ID in app/src/main/java/com/XXX/newXXX
  4. Change Bundle ID in app/src/main/java/com/XXX/newXXX/MainActivity.kt
  5. Change Bundle ID in app/src/main/java/com/XXX/newXXX/MainApplication.kt
  6. npm run android

React Native Version

0.74.5

Affected Platforms

Runtime - Android

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.22631
  CPU: (6) x64 Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz
  Memory: 2.54 GB / 15.95 GB
Binaries:
  Node:
    version: 20.17.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.22
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 10.9.0
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
      - 35.0.0
    System Images:
      - android-30 | Google Play Intel x86 Atom
      - android-35 | Google Play Experimental 16k Page Size Intel x86_64 Atom    
      - android-35 | Pre-Release 16 KB Page Size Google APIs Intel x86_64 Atom   
    Android NDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22621.0
IDEs:
  Android Studio: AI-242.23339.11.2421.12550806
  Visual Studio:
    - 17.11.35327.3 (Visual Studio Community 2022)
Languages:
  Java: 17.0.11
  Ruby:
    version: 3.3.5
    path: C:\Ruby33-x64\bin\ruby.EXE
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.5
    wanted: 0.74.5
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.76.2 is now available (your project is running on v0.74.5).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.76.2    
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.5  
info For more info, check out "https://reactnative.dev/docs/upgrading?os=windows".

Stacktrace or Logs

Your app just crashed. See the error below.
java.lang.IllegalStateException: Tried to access a JS module before the React instance was fully set up. Calls to ReactContext#getJSModule should only happen once initialize() has been called on your native module.
  com.facebook.react.bridge.ReactContext.getJSModule(ReactContext.java:180)
  org.wonday.pdf.PdfView.loadComplete(PdfView.java:139)
  com.github.barteksc.pdfviewer.listener.Callbacks.callOnLoadComplete(Callbacks.java:83)
  com.github.barteksc.pdfviewer.PDFView.loadComplete(PDFView.java:831)
  com.github.barteksc.pdfviewer.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:90)
  com.github.barteksc.pdfviewer.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:27)
  android.os.AsyncTask.finish(AsyncTask.java:771)
  android.os.AsyncTask.-$$Nest$mfinish(Unknown Source:0)
  android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
  android.os.Handler.dispatchMessage(Handler.java:107)
  android.os.Looper.loopOnce(Looper.java:232)
  android.os.Looper.loop(Looper.java:317)
  android.app.ActivityThread.main(ActivityThread.java:8705)
  java.lang.reflect.Method.invoke(Native Method)
  com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)

Reproducer

https://github.com/GenGraphic/pensionflow

Screenshots and Videos

WhatsApp Image 2024-11-20 at 08 26 26

react-native-bot commented 2 days ago

[!WARNING] Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

react-native-bot commented 2 days ago

[!WARNING] Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

migueldaipre commented 18 hours ago

Hey @GenGraphic, without a minimum reproducer we can't help you in the best way and I don't think this is a bug in the react native core.

It looks like the error is in your pdf viewing library.

GenGraphic commented 8 hours ago

The errors came with React native 0.74.5 and after i downgraded to 0.74.2 all the problems went away. So i will stick to 0.74.2 for now. Thanks anyway.