+ Start a Discussion
asapjimasapjim 

React Native project fails to start

Hi, I am trying to get the FirstReact project from Trailhead to work and I keep getting an error in Android Studio and the React-Native server when I click on the Run button in Android Studio.  Hoping that someone has run into this and can provide some insights.  I've been googling everywhere and tried a number of different things to resolve the error (delete the project and start over, gradelw clean, give all users full control over the folders, etc.) without any luck.  Any help would be greatly appreciated!!  Here's the kind of errors I am receiving:

In Android Studio:
Error:Could not read path 'C:\ReactNativeTests\FirstReact\mobile_sdk\salesforcemobilesdk-android\libs\SalesforceAnalytics\build\generated\source\r\debug\com\salesforce\androidsdk\analytics'.
> C:\ReactNativeTests\FirstReact\mobile_sdk\salesforcemobilesdk-android\libs\SalesforceAnalytics\build\generated\source\r\debug\com\salesforce\androidsdk\analytics

In the React Native server command window:
 ERROR  EPERM: operation not permitted, lstat 'C:\ReactNativeTests\FirstReact\mo
bile_sdk\salesforcemobilesdk-android\libs\SalesforceAnalytics\build\generated\so
urce\r\debug\com\salesforce\androidsdk\analytics'
{"errno":-4048,"code":"EPERM","syscall":"lstat","path":"C:\\ReactNativeTests\\Fi
rstReact\\mobile_sdk\\salesforcemobilesdk-android\\libs\\SalesforceAnalytics\\bu
ild\\generated\\source\\r\\debug\\com\\salesforce\\androidsdk\\analytics"}
Error: EPERM: operation not permitted, lstat 'C:\ReactNativeTests\FirstReact\mob
ile_sdk\salesforcemobilesdk-android\libs\SalesforceAnalytics\build\generated\sou
rce\r\debug\com\salesforce\androidsdk\analytics'
    at Error (native)

Here's some information on my system:
WinVer:
Windows 7 Professional Version 6.1 (Build 7601: Service Pack 1)

java -version:
Java version 1.8.0_144
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

npm -version 5.5.1

node -v: 6.11.4

SalesForce Mobile SDK: 5.3.0

react-native -version
react-native-cli: 2.0.1
react-native: 0.43.1

Android Studio 3.0.1

Thanks for taking a look!
Richard Whitley 15Richard Whitley 15
Hopefully you've found the solution, but if not, please try installing and using forcereact rather than forcedroid. Forcereact is new for Mobile SDK 6.0 and creates the app using the new 6.0 libraries.

npm install -g  forcereact