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

Crashes on early setTimeout in forced Indexed ram-bundle mode on Android #25859

Closed
noomorph opened this issue Jul 29, 2019 · 7 comments
Closed
Labels
Bug Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.

Comments

@noomorph
Copy link

noomorph commented Jul 29, 2019

Adding setTimeout early in code causes app to crash on start. See:

https://github.com/noomorph/IndexedRamBundleBug59_10/blob/357a24e9375ecb51eede36bdea3f2009616abf6f/index.js#L9

The issue can be reproduced only in forced indexed ram-bundle mode on Android.
Unfortunately, I cannot use RN 0.60.4 to report this issue because of another blocking bug that hinders me: #25856 .

While it is obvious that that is a bit exotic use case, it is still not clear whether that is a tip of the greater iceberg or indeed some minor wont-fix issue.

Comparison of ADB logcat dumps:

React Native version:

  React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
      Memory: 1.41 GB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.6.0 - ~/.nvm/versions/node/v12.6.0/bin/node
      npm: 6.9.0 - ~/.nvm/versions/node/v12.6.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
      Android SDK:
        API Levels: 25, 26, 27, 28
        Build Tools: 27.0.3, 28.0.3
        System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.10 => 0.59.10 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Steps To Reproduce

  1. Get an Android emulator running (for example, I was using a standard AVD, Nexus_5X_API_28 for x86_64)
  2. git clone git@github.com:noomorph/IndexedRamBundleBug59_10.git
  3. cd IndexedRamBundleBug59_10
  4. npm install
  5. cd android
  6. ./gradlew installRelease
  7. Run the app.

Describe what you expected to happen:

App should run without crashing as if it were bundled in file-based RAM bundle mode.

I mean that if I disable indexed ram bundle, it works as usual, fine, without crashes:

diff --git a/android/app/build.gradle b/android/app/build.gradle
index 134a170..c905647 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -74,7 +74,6 @@ import com.android.build.OutputFile
 
 project.ext.react = [
     bundleCommand: "ram-bundle",
-    extraPackagerArgs: ["--indexed-ram-bundle"],
     entryFile: "index.js"
 ]

Snack, code example, screenshot, or link to a repository:
https://github.com/noomorph/IndexedRamBundleBug59_10

@noomorph noomorph added the Bug label Jul 29, 2019
@react-native-bot react-native-bot added Platform: Android Android applications. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used. labels Jul 29, 2019
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.60 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.

@noomorph
Copy link
Author

noomorph commented Jul 29, 2019

Cannot update to the blocking issue #25856 , directly related to this functionality.

@react-native-bot
Copy link
Collaborator

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Aug 17, 2019
@noomorph
Copy link
Author

I wrote about why the issue cannot be tested on the latest version. There is another blocker linked to this issue.

@padlock98
Copy link

This suggestion of @noomorph is working!!! True live saver you are.

My project is running on RN0.59.10. Works in DEBUG but crashes in Release Mode. Crashed the second during startup.

It is rather difficult to find out what's the issue is, until you "adb install" the bundled apk into your simulator and use "adb logcat *:E" to detect it.

Problem:

FATAL EXCEPTION: mqt_js 
com.facebook.jni.CppException: getPropertyAsObject: property '__fbRequireBatchedBridge' is not an Object

no stack
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
...

Solution:

As suggested above, adding "bundleCommand: "ram-bundle" into "~/android/app/build.gradle" does help!

My build.gradle file looks like below:

...
project.ext.react = [
    bundleCommand: "ram-bundle",
    entryFile: "index.android.js"
]
...

Thanks @noomorph

@Kyonru
Copy link

Kyonru commented Sep 8, 2019

@padlock98 for me, it works on release, but no in debug u.u adding a bundleCommand doesn't work

@punksta
Copy link

punksta commented Sep 7, 2020

I am having this issue on 0.62.2

@facebook facebook locked as resolved and limited conversation to collaborators Oct 5, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.
Projects
None yet
Development

No branches or pull requests

5 participants