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

前端 未结 4 444
感情败类
感情败类 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: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.

提交回复
热议问题