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

RN error : Unexpected token '*' (http://localhost:8081/index.delta?platform=android&dev=true&minify=false:94148) #20576

Closed
chenlk000 opened this issue Aug 8, 2018 · 11 comments
Labels
Bug 🌐Networking Related to a networking API. Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@chenlk000
Copy link

Environment

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

Description

I meet this error when I run command: react-native run-android . Although it show me Build successful.
image
image
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.

@react-native-bot react-native-bot added 🌐Networking Related to a networking API. Platform: Android Android applications. labels Aug 8, 2018
@vdlindenmark
Copy link

Already searched for an * somewhere in your code?

@Eugnis
Copy link

Eugnis commented Aug 12, 2018

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.

@opiruyan
Copy link

I had very similar issue and rebooting system worked for me.

@dashu3f
Copy link

dashu3f commented Nov 20, 2018

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"

@theRealGupta
Copy link

please let me know the solution to this. :(

@mnlbox
Copy link

mnlbox commented Mar 11, 2019

I have same issue. My project crash without any reason.
Any working solution?

@mnlbox
Copy link

mnlbox commented Mar 11, 2019

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. 🤔

@Flammae
Copy link

Flammae commented Apr 1, 2019

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.

@Doychev
Copy link

Doychev commented Jun 21, 2019

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).

@stale
Copy link

stale bot commented Sep 19, 2019

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.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 19, 2019
@stale
Copy link

stale bot commented Sep 26, 2019

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.

@stale stale bot closed this as completed Sep 26, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug 🌐Networking Related to a networking API. Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests