How to solve Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly

蹲街弑〆低调 提交于 2020-04-05 06:33:37

问题


When i compile the Project and Run on the device than it's working fine and i checked the app in real device by USB Cable and it's running perfect but when i try to generate the release apk or try to generate the debug apk than it show The Error that gradle sync faild can not generate the apk and shows the warning/Error as

Android Studio 3.0.1 Error: Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly.


回答1:


try this go to Android Studio > Preferences > Gradle then pass the proxy details as VM options.

-Dhttp.proxyHost=www.somehost.org -Dhttp.proxyPort=8080

I added this from using this AndroidStudio gradle proxy solution




回答2:


  • First try (File/Invalidate and Restart),

If it is not working then delete below folders and again open android studio so this time android studio recreated your .gradle folder and download gradle files.

Delete beloe folders:

  • C:\Users\YOUR_USER.gradle
  • C:\Users\YOUR_USER.AndroidStudio3.3\system\caches

Hope this may help you :)




回答3:


If you want the apk immediately, then go to the project directory and run the following command in your terminal.

find . -name '*.apk'

you should be able to get your apk file path in your directory. That would be a debug apk which got created when you compiled your project and ran on the device. You can share that.



来源:https://stackoverflow.com/questions/53128804/how-to-solve-gradle-project-sync-failed-basic-functionality-e-g-editing-debu

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