問題描述
我是 android studio IDE 開發的新手.每次導入在 android studio 中開發的示例項目時,都會出現此錯誤..
I am new to android studio IDE development. Every time when I imported a sample project that developed in the android studio, I am getting this error..
沒有可用的 com.android.tools.build:gradle:1.1.0 緩存版本用于離線模式.禁用 Gradle '離線模式'并同步項目.
No cached version of com.android.tools.build:gradle:1.1.0 available for offline mode. Disable Gradle 'offline mode' and sync project.
我該如何解決這個問題.
How can I solve this problem.
推薦答案
Android Studio 3.6+ 中的新位置
查看 >工具窗口 >來自菜單欄的 Gradle.
View > Tool Windows > Gradle from the menu bar.
然后,在 Gradle 窗口頂部附近,單擊 Gradle 面板中的 Toggle Offline Mode Gradle offline 按鈕.
Then, near the top of the Gradle window, click Toggle Offline Mode Gradle offline button in the Gradle panel.
舊答案
在 Windows 上:-
轉到文件->設置.
然后打開'Build,Execution,Deployment'
.然后打開
構建工具 ->搖籃
然后取消選中 ->離線工作在右側.
Then uncheck -> Offline work on the right.
點擊確定按鈕.
然后重建項目.
在 Mac 操作系統上:-
轉到 Android Studio ->首選項,其余相同.或者按照圖片中給出的步驟進行操作
go to Android Studio -> Preferences, and the rest is the same. OR follow steps given in the image
[
這篇關于如何在 android studio 中禁用 gradle '離線模式'?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!