Vscode-react-native: .env file not found when running 'Run Android on Device'

Created on 22 Nov 2017  ยท  9Comments  ยท  Source: microsoft/vscode-react-native

After upgrading the plugin to version 0.5.5, the 'React Native: Run Android on Device' task stopped working with the error described below.

It may have something to do with https://github.com/Microsoft/vscode-react-native/pull/596 or https://github.com/Microsoft/vscode-react-native/issues/566

Actual Behavior

  1. Run 'React Native: Run Android on Device'
  2. Run the packager
  3. Error when trying to run the Android build

Expected Behavior

  1. Run 'React Native: Run Android on Device'
  2. Run the packager
  3. Run the Android build

Software versions

  • React-Native VS Code extension version: 0.5.5
  • VSCode version: 1.18.1
  • OS platform and version: Windows 10
  • NodeJS version: 7.9.0
  • React Native version: 0.47.2

Outputs (Include if relevant)

  • Output of the Debug Console (View -> Toggle Debug Console):
EMPTY
  • Output of the React-Native output channel (View -> Toggle Output -> Select React-Native in ListBox):
[Info] Attempting to start the React Native packager

[Info] Starting Packager

Scanning 718 folders for symlinks in f:\project_folder\node_modules (42ms)
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” 
 โ”‚  Running packager on port 8081.                                            โ”‚ 
 โ”‚                                                                            โ”‚ 
 โ”‚  Keep this packager running while developing on any JS projects. Feel      โ”‚ 
 โ”‚  free to close this tab and run your own packager instance if you          โ”‚ 
 โ”‚  prefer.                                                                   โ”‚ 
 โ”‚                                                                            โ”‚ 
 โ”‚  https://github.com/facebook/react-native                                  โ”‚ 
 โ”‚                                                                            โ”‚ 
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 
Looking for JS files in
   f:\project_folder 


React packager ready.

[Info] Packager started.

[Error] Failed to run the application in Android

Stack: Error: Failed to run the application in Android: ENOENT: no such file or directory, open 'C:\Program Files\Microsoft VS Code\${workspaceFolder}\.env'
    at Function.getWrappedError (C:\Users\Fernando\.vscode\extensions\vsmobile.vscode-react-native-0.5.5\src\common\error\internalError.js:35:16)
    at Function.wrapError (C:\Users\Fernando\.vscode\extensions\vsmobile.vscode-react-native-0.5.5\src\common\error\errorHelper.js:18:44)
    at resultOfCode.done.reason (C:\Users\Fernando\.vscode\extensions\vsmobile.vscode-react-native-0.5.5\src\common\entryPointHandler.js:40:72)
    at _rejected (C:\Users\Fernando\.vscode\extensions\vsmobile.vscode-react-native-0.5.5\node_modules\q\q.js:844:24)
    at C:\Users\Fernando\.vscode\extensions\vsmobile.vscode-react-native-0.5.5\node_modules\q\q.js:870:30
    at Promise.when (C:\Users\Fernando\.vscode\extensions\vsmobile.vscode-react-native-0.5.5\node_modules\q\q.js:1122:31)
    at Promise.promise.promiseDispatch (C:\Users\Fernando\.vscode\extensions\vsmobile.vscode-react-native-0.5.5\node_modules\q\q.js:788:41)
    at C:\Users\Fernando\.vscode\extensions\vsmobile.vscode-react-native-0.5.5\node_modules\q\q.js:604:44
    at runSingle (C:\Users\Fernando\.vscode\extensions\vsmobile.vscode-react-native-0.5.5\node_modules\q\q.js:137:13)
    at flush (C:\Users\Fernando\.vscode\extensions\vsmobile.vscode-react-native-0.5.5\node_modules\q\q.js:125:13)
Loading dependency graph, done.
  • Output of the Developer Tools console (Help -> Toggle Developer Tools -> Select Console tab):
No relevant info
bug triaged

Most helpful comment

Sorry guys!
Please try again with 0.5.7

All 9 comments

@Fernando-Marquardt
Thanks for reporting!
Have been fixed in 0.5.6

@iTOYS I'm still getting this error in 0.5.6

@iTOYS I am still getting the same error after updating to 0.5.6.

@iTOYS Also getting this same error after upgrading to 0.5.6, when trying to run on an iOS device.

Sorry guys!
Please try again with 0.5.7

Hey! 0.5.7 worked for me. Thank you!

Works! Thanks

am getting this error in 0.6.5

@YogeshLegendkiller could you please provide as more info i.e. how to reproduce it step by step, your env, rn versions, NodeJS version, OS etc?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

webda2l picture webda2l  ยท  3Comments

molant picture molant  ยท  3Comments

bugproof picture bugproof  ยท  5Comments

yuki2006 picture yuki2006  ยท  5Comments

kralcifer-ms picture kralcifer-ms  ยท  4Comments