React Native: conversion error for unexpected token (

I followed the exact instructions provided in the React Native Android Setup Page and ran the code without any problems yesterday. Today I am trying to run the same code. As said below, "build completed successfully", but I see that there is only the android/build/intermediates/dex-cache/cache.xml and nothing else in the android/builid . There is also the following error as shown in this figure . I am trying to figure out what is wrong. Here is the terminal output:

 ugur@ugur-Lenovo-ideapad-510-15IKB :~/Desktop/tutorials/react native tutorial/NewPro$ react-native run-android Scanning 559 folders for symlinks in /home/ugur/Desktop/tutorials/react native tutorial/NewPro/node_modules (2ms) Starting JS server... Building and installing the app on the device (cd android && ./gradlew installDebug)... Incremental java compilation is an incubating feature. :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE :app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE :app:prepareComFacebookFrescoDrawee101Library UP-TO-DATE :app:prepareComFacebookFrescoFbcore101Library UP-TO-DATE :app:prepareComFacebookFrescoFresco101Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipeline101Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipelineBase101Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipelineOkhttp3101Library UP-TO-DATE :app:prepareComFacebookReactReactNative0471Library UP-TO-DATE :app:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE :app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:mergeDebugShaders UP-TO-DATE :app:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:bundleDebugJsAndAssets SKIPPED :app:processDebugManifest UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources UP-TO-DATE :app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE :app:compileDebugJavaWithJavac UP-TO-DATE :app:compileDebugNdk UP-TO-DATE :app:compileDebugSources UP-TO-DATE :app:transformClassesWithDexForDebug UP-TO-DATE :app:mergeDebugJniLibFolders UP-TO-DATE :app:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE :app:processDebugJavaRes UP-TO-DATE :app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE :app:validateSigningDebug :app:packageDebug UP-TO-DATE :app:assembleDebug UP-TO-DATE :app:installDebug Installing APK 'app-debug.apk' on 'SM-N910C - 6.0.1' for app:debug Installed on 1 device. BUILD SUCCESSFUL Total time: 17.032 secs Running /home/ugur/Android/Sdk/platform-tools/adb -s 4100fef8e47db1b3 reverse tcp:8081 tcp:8081 adb server version (32) doesn't match this client (39); killing... * daemon started successfully * Starting the app on 4100fef8e47db1b3 (/home/ugur/Android/Sdk/platform-tools/adb -s 4100fef8e47db1b3 shell am start -n com.newpro/com.newpro.MainActivity)... Starting: Intent { cmp=com.newpro/.MainActivity } 

My OS is an elementary OS, Node v6.11.2, reaction-native-cli v2.0.1.

I would be happy if you walk me through to find out what is happening with my build.

+5
source share
4 answers

This is related to babel-preset-react-native modules. Try to run

 yarn remove babel-preset-react-native yarn add babel-preset-react-native@2.1.0 

Or if you use NPM,

 npm uninstall babel-preset-react-native npm install babel-preset-react-native@2.1.0 
+17
source

This topic was answered by : fooobar.com/questions/1270945 / ...

It worked for me.

Workaround:

 "dependencies": { "react": "16.0.0-alpha.12", "react-native": "0.47.1", "babel-preset-react-native": "2.1.0" }, 

See above, now babel-preset-react-native values ​​point to 2.1.0. Then,

 rm -rf node_module npm cache clean npm i 

And restart some android or ios.

+2
source

Delete the node_modules folder, then run the command.

  npm install 

Then run the project.

0
source

Try to kill any process on port 8081

if you are on a MAC, run the following command

 sudo lsof -n -i4TCP:8081 
0
source

Source: https://habr.com/ru/post/1270942/


All Articles