Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Error while building React Native project

I am getting following error

FAILURE: Build failed with an exception.

* Where:
Settings file 'G:\ReactNative\Contacts\android\settings.gradle' line: 3

    * What went wrong:
    Could not compile settings file 'G:\ReactNative\Contacts\android\settings.gradle'.
    > startup failed:
      settings file 'G:\ReactNative\Contacts\android\settings.gradle': 3: unexpected char: '\' @ line 3, column 133.
         s\react-native-gesture-handler\android')

settings.gradle

rootProject.name = 'Contacts'
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-gesture-handler\android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-vector-icons\android')

include ':app'

What is actually wrong with this file?

like image 717
Adeel Iftikhar Avatar asked Feb 01 '19 09:02

Adeel Iftikhar


People also ask

What's the real cause behind performance issues in React Native?

Memory leakage, a React Native performance issue, may occur due to unnecessary processes that run in the background in an Android app. Try using scrolling lists like SectionList, FlatList, or VirtualList, instead of ListView.

How do I install React Native project in Windows 10?

Get started with React Native by installing required toolsInstall Visual Studio Code (or your code editor of choice). Install Android Studio for Windows. Android Studio installs the latest Android SDK by default. React Native requires Android 6.0 (Marshmallow) SDK or later.

Can you build React Native on Windows?

React Native is an open-source mobile application framework created by Facebook. It is used to develop applications for Android, iOS, Web and UWP (Windows) providing native UI controls and full access to the native platform.


1 Answers

Try forward slashes / instead of backslash \

use code

rootProject.name = 'Contacts'
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')

include ':app'

instead of

rootProject.name = 'Contacts'
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-gesture-handler\android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-vector-icons\android')

include ':app'

Hope it will help

like image 78
Muhammad Ashfaq Avatar answered Jan 04 '23 05:01

Muhammad Ashfaq