How to restore build.gradle and .Gradle folder

帅比萌擦擦* 提交于 2019-12-02 05:36:42

If your are not using a VCS:

  • try use the local history to recovery the build.gradle file in your root folder (right click on the root folder)

  • If it fails. you can create a new project and copy the build.gradle. Usually this file contains generic info (like android gradle pluging and the repos to be used in the modules)

  • the .gradle folder is not a problem. Gradle wrapper will recreate this file

I copied both from a different project and pasted them in my project. That didn't solve the problem and I imported the project File->new->import project but that only created a duplicate within my project. I closed the project and deleted it from the list of project in Android studio. Then I created a project by importing it from Android Studio Projects folder. It took forever stuck in the gradle build and I have to restart AS manually. Now I have all my files and the project is compiling as it should.

You just need to reimport your project it will by default create the new gradle folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!