問題描述
錯誤:沒有緩存版本的 com.google.gms:google-services:1.4.0-beta3 可用于離線模式.禁用 Gradle 的離線模式"并同步項目
Error:No cached version of com.google.gms:google-services:1.4.0-beta3 available for offline mode. Disable Gradle 'offline mode' and sync project
我正面臨這個問題,因為我在 android studio 中以離線模式工作.有人可以告訴我這個緩存文件存儲在我的 Windows 中的什么位置以及我從哪里獲取這個文件,以便我可以單獨下載并粘貼/保留它,然后構建我的 android 項目.
I am facing this issue because I am working in offline mode in android studio. Can some body please tell me where is this cached file stored in my windows and from where I'll get this file so that I can separately download it and paste/keep it, and build my android project.
推薦答案
離線模式不允許你完全離線工作.它實際上是一種良好的緩存模式.每當您添加新的依賴項時,您HAVE 可以同步項目,ATLEAST ONCE.Android Studio 必須下載(然后緩存)應用程序才能運行的依賴項.一旦你同步了 gradle 文件,你就可以切換到離線模式,你就可以工作了.
The Offline mode does not allow you to completely work offline. Its actually a GOOD cache mode. Whenever you add new dependencies, You HAVE to gradle sync the project, ATLEAST ONCE. Android studio has to download(then cache) the dependencies for the app to work. Once you sync the gradle files, then you can switch to offline mode, and you can work.
如果您必須離線工作,那么我建議您確定應用程序中所需的所有依賴項.一次添加它們并同步 Gradle.然后切換到離線模式.
If you must work offline, then i would suggest determining all the dependencies you need in your application. Add them all at once and Gradle sync. Then switch to Offline mode.
更新
如果您在代理網(wǎng)絡后面工作,請轉到 File-> Settings -> Under Appearence &行為 -> 在系統(tǒng)設置下 -> HTTP 代理 -> 單擊手動代理配置,然后添加必要的詳細信息.然后轉到您的 gradle.properties 文件,該文件應包含以下內容:
UPDATE
If you are working behind a proxy network, then goto File-> Settings -> Under Appearence & Behavior -> Under System Settings -> HTTP Proxy -> Click on Manual proxy configuration, and add the neccessary details. Then goto your gradle.properties file which should contain sometyhing like this :
systemProp.http.proxyPassword=your_password
systemProp.http.proxyHost=host_Ip_address
systemProp.http.proxyUser=your_username
systemProp.http.proxyPort=port_number
將此連同上述內容一起添加到您的文件中:
Add this to your file, along with the above :
systemProp.https.proxyPassword=your_password
systemProp.https.proxyHost=host_Ip_address
systemProp.https.proxyUser=your_username
systemProp.https.proxyPort=port_number
可以從瀏覽器的代理設置中找到這些詳細信息.
These details can be found out from your browser's proxy settings.
這篇關于沒有可用于離線模式的 com.google.gms:google-services:1.x.x 的緩存版本的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!