本文介绍了如何解决 Gradle 项目同步失败.基本功能(例如编辑、调试)将无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我编译项目并在设备上运行时,它运行良好,我通过 USB 电缆检查了真实设备中的应用程序,它运行良好,但是当我尝试生成发布版 apk 或尝试生成调试 apk 时显示 gradle 同步失败的错误无法生成 apk 并将警告/错误显示为

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 错误:Gradle 项目同步失败.基本功能(例如编辑、调试)将无法正常工作.

推荐答案

试试这个转到 Android Studio > 首选项 > Gradle然后将代理详细信息作为 VM 选项传递.

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

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

我通过使用这个 AndroidStudio gradle proxy 解决方案添加了这个

I added this from using this AndroidStudio gradle proxy solution

这篇关于如何解决 Gradle 项目同步失败.基本功能(例如编辑、调试)将无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 12:53