Gradle sync failed: Cause: error=2, No such file or directory

前端 未结 4 442
感情败类
感情败类 2021-01-17 23:56

I am trying to get the latest revision number of mercurial repository dynamically and have it in the versionName of the android app.

This is what I have in the grad

相关标签:
4条回答
  • 2021-01-18 00:27

    The issue I had with this was that I'd messed up the path contained in my ~/.profile file.

    I solved it by running export PATH=/opt/local/bin:/opt/local/sbin:$PATH in my terminal to get back my ability to use vim. Then I just pasted the same command: export PATH=/opt/local/bin:/opt/local/sbin:$PATH into my ~/.profile.

    Invalidated the cache from Android Studio, and it worked like a charm.

    I hope this helps someone!

    0 讨论(0)
  • 2021-01-18 00:29

    This solved the issue for me

    1) Update to latest Android Studio(optional)

    2) In the studio, File -> Project Structure -> take a note of the directory path for "Android NDK location" and open the folder on your machine. Now Step out into the /sdk/ folder and delete the "ndk-bundle" folder. This takes a bit of time because of all the files.

    3) Back in Studio, open File -> Project Structure -> take a note of the directory path for "Android NDK location" again , and this time you shoul dbe seeing an error. Delete the "Android NDK location" path -> click OK

    4) Rebuild the project, Invalidate caches and restart.You shouldn't see the error anymore.

    0 讨论(0)
  • 2021-01-18 00:36

    In my case using Linux Mint, I had to install nodejs in sudo mode.

    Android Studio runs the commands on the terminal as a super user, so I had nodejs installed on my user but not "root" (sudo).

    To install, I followed this instructions: https://github.com/nodesource/distributions/blob/master/README.md

    0 讨论(0)
  • 2021-01-18 00:41

    In my case, macOS had removed one of the binaries in my NDK bundle. You can find them in your Trash. Actually I got a pop-up message on the screen which has been asking to Trash the binary since the developer is not verified. As for any other mac apps, you have to go to:

    Apple menu  > System Preferences > Security & Privacy

    Then from the General tab, click on Open Anyway.

    0 讨论(0)
提交回复
热议问题