Android Emulator 22 - x86
I follow Integration With Existing Apps to build a demo , but get error.
RN Version
➜ demo git:(master) ✗ react-native -v
react-native-cli: 1.0.0
react-native: 0.34.0
09-28 11:35:29.418 3360-3585/? E/ReactNativeJS: undefined is not a function (evaluating 'remoteModules.forEach')
09-28 11:35:29.421 3360-3585/? E/ReactNative: Got JS Exception: TypeError: undefined is not a function (evaluating 'remoteModules.forEach')
--------- beginning of crash
09-28 11:35:29.422 3360-3585/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xbadbef07 in tid 3585 (mqt_js)
+1
I followed the same guide
react-native-cli: 1.0.0
react-native: 0.34.1
react: 15.3.2
com.android.support:appcompat-v7:23.0.1
buildToolsVersion "23.0.1"
com.android.tools.build:gradle:2.2.0
error:
E/unknown:React: Exception in native call from JS
com.facebook.react.bridge.JSExecutionException: TypeError: undefined is not a function (evaluating 'remoteModules.forEach') (http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false:7397)
com.facebook.react.bridge.ReactBridge.loadScriptFromFile(Native Method)
com.facebook.react.bridge.JSBundleLoader$2.loadScript(JSBundleLoader.java:58)
com.facebook.react.bridge.CatalystInstanceImpl$2.call(CatalystInstanceImpl.java:146)
com.facebook.react.bridge.CatalystInstanceImpl$2.call(CatalystInstanceImpl.java:137)
com.facebook.react.bridge.queue.MessageQueueThreadImpl$1.run(MessageQueueThreadImpl.java:73)
android.os.Handler.handleCallback(Handler.java:739)
android.os.Handler.dispatchMessage(Handler.java:95)
com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
android.os.Looper.loop(Looper.java:135)
com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:184)
java.lang.Thread.run(Thread.java:818)
--------- beginning of crash
I fix it . I make the wrong maven repositories.
The Integration With Existing Apps set the maven like this:
maven {
// All of React Native (JS, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
and I change it like this:
maven {
url "$rootDir/node_modules/react-native/android"
}
It works for me.
@flyer88 I changed it as you said but it is still not working for me, getting the same error.
do we need to define $rootDir anywhere?
I use AndroidStudio create an android project, like this

$rootDir meas RNDemo
so the node_modules path is"$rootDir/node_modules/.."
rather than "$rootDir/../node_modules/..."
@flyer88 So you ran "npm init" inside "RNApp" folder? and did all the steps inside that folder? because I did that inside "RNDemo" folder (as per ur project).
I am trying to navigate to MyReactActivity from MainActivity's Button click.
I have placed "MyReactActivity" and "MainActivity" inside app/ directory.
so do I need to place "MyReactActivity" inside RNApp/ ?
Can you send me a working sample project zip if you don't mind? Trying to solve this since yesterday but no luck.
I ran npm init in RNDemo, I write js in RNApp floder.
@Krupen I just change my demo, I will push a new demo to my github
@flyer88 okay, just tell me the repo name, or post its link here. Thank you.
@Krupen RNDemo
@Krupen
mavenLocal()
maven {
url "$rootDir/../node_modules/react-native/android"
}
The reason is that the react-native version is not right
react-native-cli: 1.0.0
react-native: 0.34.1
react: 15.3.2
need help ~~
My issue is now solved, I was placing maven in wrong place.
I was placing maven inside "buildscript" block while actually it should be placed in "allprojects" block.
The maven path that works for me is:
maven {
// All of React Native (JS, Android binaries) is installed from npm
url "$rootDir/node_modules/react-native/android"
}
你用react-native init 新建一个项目,对比下代码 0.34.1 新建出来的项目有mainapplication, mainactivity里面也有变化
From: Kris(李强)
Date: 2016-09-29 14:24
To: facebook/react-native
CC: gaoyang1987; Mention
Subject: Re: [facebook/react-native] ReactNativeJS: undefined is not a function (evaluating 'remoteModules.forEach') (#10140)
@gaoyang1987 what dose the mean ? i have the same issue when i updating the react-native project from 0.25.1 to 0.34.1.
react-native-cli: 1.0.0
react-native: 0.34.1
react: 15.3.2
need help ~~
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
@Krupen Thank you. It should be placed in "allprojects" block.
Hey, I have the same issue.
I did follow Integration with Existing Apps too.
@flyer88
maven {
url "$rootDir/node_modules/react-native/android"
}
The above change did not actually work for me. In fact it does not even build successfully when I change the url as above.
Posting my stack trace below.
10-14 13:34:17.214 3801-4097/demo.com.simplereactdemo E/ReactNativeJS: undefined is not a function (evaluating 'remoteModules.forEach')
10-14 13:34:17.220 3801-4097/demo.com.simplereactdemo I/ReactNativeJS: 'Failed to print error: ', 'Requiring module "58", which threw an exception.'
10-14 13:34:17.221 3801-4097/demo.com.simplereactdemo E/ReactNative: Got JS Exception: TypeError: undefined is not a function (evaluating 'remoteModules.forEach')
10-14 13:34:17.223 3801-4097/demo.com.simplereactdemo E/unknown:React: Exception in native call from JS
com.facebook.react.bridge.JSExecutionException: TypeError: undefined is not a function (evaluating 'remoteModules.forEach') (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false:7398)
at com.facebook.react.bridge.ReactBridge.loadScriptFromFile(Native Method)
at com.facebook.react.bridge.JSBundleLoader$2.loadScript(JSBundleLoader.java:58)
at com.facebook.react.bridge.CatalystInstanceImpl$2.call(CatalystInstanceImpl.java:146)
at com.facebook.react.bridge.CatalystInstanceImpl$2.call(CatalystInstanceImpl.java:137)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$1.run(MessageQueueThreadImpl.java:73)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:148)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:184)
at java.lang.Thread.run(Thread.java:818)
10-14 13:34:17.255 3801-4097/demo.com.simplereactdemo A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xbbadbeef in tid 4097 (mqt_js)
Looks like as a docs issue this is a dupe. PRs to improve the docs here would be great! Anyway I am going to close this one.
Most helpful comment
I fix it . I make the wrong maven repositories.
The Integration With Existing Apps set the maven like this:
and I change it like this:
It works for me.