問(wèn)題描述
錯(cuò)誤:沒(méi)有緩存版本的 com.google.gms:google-services:1.4.0-beta3 可用于離線模式.禁用 Gradle 的離線模式"并同步項(xiàng)目
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
我正面臨這個(gè)問(wèn)題,因?yàn)槲以?android studio 中以離線模式工作.有人可以告訴我這個(gè)緩存文件存儲(chǔ)在我的 Windows 中的什么位置以及我從哪里獲取這個(gè)文件,以便我可以單獨(dú)下載并粘貼/保留它,然后構(gòu)建我的 android 項(xiàng)目.
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.
推薦答案
離線模式不允許你完全離線工作.它實(shí)際上是一種良好的緩存模式.每當(dāng)您添加新的依賴項(xiàng)時(shí),您HAVE 可以同步項(xiàng)目,ATLEAST ONCE.Android Studio 必須下載(然后緩存)應(yīng)用程序才能運(yùn)行的依賴項(xiàng).一旦你同步了 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.
如果您必須離線工作,那么我建議您確定應(yīng)用程序中所需的所有依賴項(xiàng).一次添加它們并同步 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)絡(luò)后面工作,請(qǐng)轉(zhuǎn)到 File-> Settings -> Under Appearence &行為 -> 在系統(tǒng)設(shè)置下 -> HTTP 代理 -> 單擊手動(dòng)代理配置,然后添加必要的詳細(xì)信息.然后轉(zhuǎn)到您的 gradle.properties 文件,該文件應(yīng)包含以下內(nèi)容:
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
將此連同上述內(nèi)容一起添加到您的文件中:
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
可以從瀏覽器的代理設(shè)置中找到這些詳細(xì)信息.
These details can be found out from your browser's proxy settings.
這篇關(guān)于沒(méi)有可用于離線模式的 com.google.gms:google-services:1.x.x 的緩存版本的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!