Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Unable to start the app #8

Closed
mtapdilli opened this issue Nov 12, 2020 · 13 comments
Closed

Unable to start the app #8

mtapdilli opened this issue Nov 12, 2020 · 13 comments

Comments

@mtapdilli
Copy link

mtapdilli commented Nov 12, 2020

  • Running nx start my-app gives below error :
    **The run-ios build requires OSX to run**

  • Running nx run-android my-app gives below error :
    EPERM: operation not permitted, symlink '_**path to the workspace**_\node_modules\react-native' -> '*_path to the workspace*_\apps\my-app\node_modules\react-native'

  • Running nx build-android my-app gives below error :
    spawn _**path to the workspace**_\apps\my-app\android\gradlew ENOENT

Platform : Windows
Nx --version : 10.3.3

Steps Followed :

  • Ran npx create-nx-workspace@latest and selected empty workspace layout
    And then ran below commands as suggested by @jaysoo in this comment
  • yarn add @nrwl/react-native@10.4.0-beta.2
    nx g @nrwl/react-native:app my-app
    ....
    ....
@nclarx
Copy link

nclarx commented Nov 12, 2020

If you're on Windows you won't have the simulator for iOS - that's a MacOS only thing as far as I know. Others who know the ecosystem better might have some suggestions?

@jaysoo
Copy link
Member

jaysoo commented Nov 12, 2020

@nclarx is right, iOS requires a toolchain that only OSX provides.

For Android, I it looks like the symlink operation didn't work for you -- React Native has hard-coded node_modules paths in some of it's scripts so the symlink is needed to work. I'll double-check on a Windows machine.

@mtapdilli
Copy link
Author

mtapdilli commented Nov 12, 2020

Sure @jaysoo . I was only trying to run Android app, did not touch iOS. I ran nx start my-app as it was mentioned that it will "Start JS bundler" and got the error that I have mentioned i.e., The run-ios build requires OSX to run

@jaysoo
Copy link
Member

jaysoo commented Nov 12, 2020

Oh yes, I see there's an erroneous platform check for the bundler builder. I'll patch that.

@jaysoo jaysoo closed this as completed in 96ffb15 Nov 12, 2020
@jaysoo
Copy link
Member

jaysoo commented Nov 12, 2020

@mtapdilli Can you try 10.4.0-beta.5?

@jaysoo jaysoo reopened this Nov 12, 2020
@jaysoo
Copy link
Member

jaysoo commented Nov 12, 2020

Investigating the symlink issue. I can reproduce it in Windows.

@jaysoo
Copy link
Member

jaysoo commented Nov 12, 2020

@mtapdilli Can you try 10.4.0-beta.6?

@jaysoo
Copy link
Member

jaysoo commented Nov 13, 2020

I'm able to start the bundler and run the android app in Windows. Closing this issue.

@jaysoo jaysoo closed this as completed Nov 13, 2020
@mtapdilli
Copy link
Author

Hey @jaysoo . Just tried beta.6. I Am able to run the android app. Cheers 🥂

Note : I was getting an error like "Exception in thread "main" java.util.zip.ZipException: error in opening zip file". I got it to work after clearing the ".gradle\wrapper\dists\gradle-6.0.1-all\99d3u8wxs16ndehh90lbbir67" directory. Users might get this if they already the gradle zip file in the directory. So, just a leaving a note here.

And below one still persists :
Running nx build-android my-app gives below error :
spawn path to the workspace\apps\my-app\android\gradlew ENOENT

I can see it has got something to do with permission. Let me know if you have any inputs on this.

@mtapdilli
Copy link
Author

@jaysoo Not sure if this is somehow causing the #23

Can we just re-open this to track the below issue that was left out ?

  • Running nx build-android my-app gives below error :
    spawn path to the workspace\apps\my-app\android\gradlew ENOENT

@jaysoo
Copy link
Member

jaysoo commented Dec 3, 2020

ENOENT is because the file is not found. I'll take to take a look on a Windows machine again, but it's not a permissions issue.

@mtapdilli
Copy link
Author

@jaysoo I could get build-android command get to work in my system after changing this line from join(projectRoot, 'android/gradlew') to join(projectRoot, 'android/gradlew.bat')

I am thinking root cause might this : nodejs/node-v0.x-archive#2318 (comment)

I think we will have to update it to run gradlew/gradlew.bat based on the platform. You review it and take a call.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants