Environment:
OS: Windows 10
Node: 10.7.0
Yarn: 1.9.4
npm: 6.1.0
Watchman: 4.9.4
Xcode: N/A
Android Studio: 3.1.3
Packages: (wanted => installed)
react-native-cli: 2.0.1
react-native: 0.55.4
I meet this error when I run command: react-native run-android . Although it show me Build successful.


And in android studio ,the logcat shows words below:
8-08 16:41:20.296 19265-19412/com.securemail E/ReactNativeJNI: Got JS Exception: Unexpected token '*' (http://localhost:8081/index.delta?platform=android&dev=true&minify=false:94148)
08-08 16:41:20.298 19265-19412/com.securemail E/unknown:ReactNative: Exception in native call from JS
com.facebook.react.devsupport.JSException: Unexpected token '*' (http://localhost:8081/index.delta?platform=android&dev=true&minify=false:94148)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:224)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:818)
Caused by: com.facebook.jni.CppException: Unexpected token '*' (http://localhost:8081/index.delta?platform=android&dev=true&minify=false:94148)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:224)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:818)
08-08 16:41:20.300 19265-19412/com.securemail E/unknown:ReactNative: Exception in native call
java.lang.RuntimeException: Error calling AppRegistry.runApplication
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:224)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:818)
Caused by: com.facebook.jni.CppException: Could not get BatchedBridge, make sure your bundle is packaged correctly
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:224)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:818)
Someone said delete the files in assets and run under command can help, but I tried it and no use, feeling confused.
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
I tested other mobilephone but no use. Please help me ,thanks a lot.
Already searched for an * somewhere in your code?
Had the similar problem. You need to download http://localhost:8081/index.delta?platform=android&dev=true&minify=false directly (from browser etc.), then open in editor and search for row 94148 from which your error came from.
After that you'll see exactly the place of error and be able to find it in your project's js files.
I had very similar issue and rebooting system worked for me.
Edit android/app/build.gradle
use this
compile ("com.facebook.react:react-native:0.44.0") { force = true }
and write version of app you use instead of 0.44.0 and delete something like this compile "com.facebook.react:react-native:+" or this compile "com.facebook.react:react-native:0.44.0"
please let me know the solution to this. :(
I have same issue. My project crash without any reason.
Any working solution?
Guys I found the problem.
I remove my node_modules and use npm install and anything works well but when I use yarn install it's break with this error:
Unexpected token '*' (http://localhost:8081/index.delta?platform=android&dev=true&minify=false:...)
It seems it's a yarn issue. :thinking:
Just fixed the problem after hours of headache. for me, the problem was one of my dependencies was using * operator which was not recognized by my babel compiler (apologies if I misused the terms, I am not very experienced with these staff). so I went there and changed * operator with the regular Math.pow().
for me the file that was causing the issue was
\node_modules\react-native-elements\src\tooltip\getTooltipCoordinate.js
third line, in react-native-elements library.
check your last installed libraries for same operator and replace. probably not the best way to fix it but at least you'll know what's causing the issue.
I just encountered a similar problem after some package updates.
Turns out if you start Remote Debugging (open the dev menu and press Debug JS Remotely), you get a more detailed explanation of the error - in my case, one of the new versions of my dependencies required a newer version of RN (and I'm yet to migrate that to a later version).
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
Most helpful comment
Just fixed the problem after hours of headache. for me, the problem was one of my dependencies was using * operator which was not recognized by my babel compiler (apologies if I misused the terms, I am not very experienced with these staff). so I went there and changed * operator with the regular Math.pow().
for me the file that was causing the issue was
\node_modules\react-native-elements\src\tooltip\getTooltipCoordinate.jsthird line, in react-native-elements library.
check your last installed libraries for same operator and replace. probably not the best way to fix it but at least you'll know what's causing the issue.