-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Android: Crash after Requesting Bundle #10925
Comments
It would seem possibly related somehow to this |
From previous conversations I am trying to pull what I think the relevant bits might be from the relevant files: AndroidManifest.xml compile 'com.android.support:appcompat-v7:23.0.1' package.json "dependencies": { |
Excellent, I have now got to the red screen and successfully followed the rest of the instructions. However it is still crashing, this time with: adb logcat *:S ReactNative:V ReactNativeJS:V |
What command did you use to start the packager server? Does the log output reveal anything interesting? |
The batchedBridge problem usually happens when your bundle hasn't been generated properly. I'm going to close this issue for now because these duplicate issues with |
Feel free to open a new issue with a very specific problem and clear steps to reproduce it. |
For the record, I used npm start, with the following in the package.json
As per the integrating with previous apps doc The log output of the packager seems pretty uninteresting:
|
@LiamInJapan did you ever resolve the issue with |
cc @iam-peekay |
@skevy running into this as well. Were you able to fix it? |
It was actually @iam-peekay who was having this issue, I was just trying (unsuccessfully) to help her out. Preethi, did you ever make it past this issue? |
I am getting the same:
I am integrating some RN code with an existing Android app. Everything is updated. I thought I was running the wrong npm start from a different directory, but that isn't the case either. The app crashes after: Regarding the output of the packager, it fails after all the files have been transformed.
|
I faced the same problem when trying to integrate RN into an existing app. I followed the guide here but ended up with the The solution was to create a new RN project from scratch, with the same name as my current app, and then compare what was different between the new project and my existing one. By identifying and correcting these differences, I got my current app to work with RN as intended. Here's a list of the differences I noticed and the actions I took to fix them:
Other than that, I followed the instructions in the integration guide (like adding the react native gradle line and the maven url). After these steps, the React Native component was rendered successfully without any crashes. |
What I can see from my side is that gradle is picking RN 0.20.0+ from Maven, instead of RN 0.39.2 in the node_modules directory. That's why I am not able to use "onHostDestroy()" or "onHostPause()" in my ReactActivity. However I am not sure if this is related, because with 0.20.0+ it just crashes. |
@edo1493 I had the same problem with Do you have the line |
@edo1493 Now that you mentioned RN 0.20.0, I realized what the problem was. This snippet in my gradle file
had a wrong path to the React Native jars. When gradle can't find RN in this path, it doesn't throw an error, but instead looks in maven and finds an old version of it (0.20.0). You can see here that's the latest version maven has: https://mvnrepository.com/artifact/com.facebook.react/react-native So that's why the bundle was failing: the app was using a very old version of RN. It also explains why we didn't have access to Fixing the path to the local RN library solved the problem. Now the app is using RN 0.39.2 and the bundle doesn't fail anymore. |
@edo1493 @lucas-tulio these code/configs worked for me in integrating RN v0.39.2 with existing app. I hope it helps. top-level build.gradle file:
app-level build.gradle file:
MyReactActivity file:
|
Running into this one on iOS today, an actual fix would prevent this problem from ever happening in the first place, there shouldn't be any reasons for an infinite recursion instead of a friendly, descriptive error message in the console. Thanks. |
Same exception is coming in production but not in debug mode. |
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally! If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution. |
Thanks @lucas-tulio; your second comment pointed me in the right direction! To eliminate the possibility of Gradle resolving the wrong version of React Native, be sure to specify an explicit version of the compile 'com.facebook.react:react-native:0.48.4' Consequently, an incorrect Maven |
Description
I am following the guide here to integrate React Native with a pre-existing app.
I am doing this via a normal native button. I press this and I execute the setup code in the article.
I see a spinner on the screen and it informs me that the app is "fetching JS bundle".
Output in the command line bundler also confirms this:
[11/14/2016, 4:54:42 PM] Requesting bundle url: /index.android.bundle?platform=android&dev=true&hot=false (327ms)
Unfortunately I then get a crash with the following logcat output:
W/unknown:React(13970): You seem to be running on device. Run 'adb reverse tcp:8081 tcp:8081' to forward the debug server's port to the device. E/AndroidRuntime(13970): FATAL EXCEPTION: AsyncTask #3 E/AndroidRuntime(13970): Process: com.xxxxxxxx, PID: 13970 E/AndroidRuntime(13970): java.lang.RuntimeException: An error occured while executing doInBackground() E/AndroidRuntime(13970): at android.os.AsyncTask$3.done(AsyncTask.java:304) E/AndroidRuntime(13970): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) E/AndroidRuntime(13970): at java.util.concurrent.FutureTask.setException(FutureTask.java:222) E/AndroidRuntime(13970): at java.util.concurrent.FutureTask.run(FutureTask.java:242) E/AndroidRuntime(13970): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) E/AndroidRuntime(13970): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E/AndroidRuntime(13970): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E/AndroidRuntime(13970): at java.lang.Thread.run(Thread.java:818) E/AndroidRuntime(13970): Caused by: java.lang.IllegalAccessError: Method 'void android.support.v4.net.ConnectivityManagerCompat.<init>()' is inaccessible to class 'com.facebook.react.modules.netinfo.NetInfoModule' (declaration of 'com.facebook.react.modules.netinfo.NetInfoModule' appears in /data/data/com.xxxx/files/instant-run/dex/slice-com.facebook.react-react-native-0.20.1_b45e38dcf4b17e67a28c8f304d2b842bb0467fc3-classes.dex) E/AndroidRuntime(13970): at com.facebook.react.modules.netinfo.NetInfoModule.<init>(NetInfoModule.java:55) E/AndroidRuntime(13970): at com.facebook.react.shell.MainReactPackage.createNativeModules(MainReactPackage.java:67) E/AndroidRuntime(13970): at com.facebook.react.ReactInstanceManagerImpl.processPackage(ReactInstanceManagerImpl.java:793) E/AndroidRuntime(13970): at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:730) E/AndroidRuntime(13970): at com.facebook.react.ReactInstanceManagerImpl.access$600(ReactInstanceManagerImpl.java:91) E/AndroidRuntime(13970): at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:184) E/AndroidRuntime(13970): at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:169) E/AndroidRuntime(13970): at android.os.AsyncTask$2.call(AsyncTask.java:292) E/AndroidRuntime(13970): at java.util.concurrent.FutureTask.run(FutureTask.java:237) E/AndroidRuntime(13970): ... 4 more W/ActivityManager( 523): Force finishing activity 1 com.xxxx/com.xxxxxxx.LoginActivity
I have tried:
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:appcompat-v4:23.0.1'
compile 'com.facebook.react:react-native:+'
compile 'com.facebook.react:react-native:0.20.+'
I'm at a bit of a loss as to how to proceed/debug this issue.
Reproduction
Follow guide above.
Hook up guides code to a button is a fairly typical login view.
Press button. Watch spinner popup saying "Requesting JS Bundle"
Confirm in npm start/packager console output.
Watch it crash. Check output in logcat
Additional Information
The text was updated successfully, but these errors were encountered: