久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

無法解決:帶有 gradle 的 IntelliJ Idea 中的 com.googl

Failed to resolve: com.google.android.gms:play-services in IntelliJ Idea with gradle(無法解決:帶有 gradle 的 IntelliJ Idea 中的 com.google.android.gms:play-services)
本文介紹了無法解決:帶有 gradle 的 IntelliJ Idea 中的 com.google.android.gms:play-services的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我正在嘗試在 IntelliJ Idea 中將 Google Play 服務添加到我的 libGDX 項目中.我在這里遵循了設置指南:

我使用的是 API 級別 26,但無論如何其他定義確實使用了與 Android SDK 完全相同的目錄.此外,我在這臺筆記本電腦上根本沒有安裝任何其他 android SDK,所以毫無疑問,Idea 只使用那個和那個.

歡迎提出任何想法.

提前致謝!

解決方案

我剛剛用 11.0.0 替換了 11.2.0 版本,然后它似乎工作正常,所以這意味著 11.2.0 不包含在最新的 Android SDK.

所以,在與所有可用的零散文檔苦苦掙扎之后,我純粹是偶然發現了這個文檔(我猜它沒有被 Google 索引到足夠高的位置):https://developers.google.com/android/guides/releases

我從那里引用:

<塊引用>

Google Play 服務 11.2 版的亮點.谷歌播放服務依賴項現在可通過 maven.google.com 獲得

現在,即使這并不一定意味著下載的 SDK 不再提供它們,但似乎情況確實如此.

無論如何,將 google() 添加到我的 build.gradle 中不起作用(未找到、未定義或其他任何...),因此我使用了在本文檔中找到的另一種方法,該方法參考了上一篇:

https://developer.android.com/studio/build/dependencies.html#google-maven

我修改了我的 build.gradle 文件,將該行添加到 allprojects/repositories,如下所示:

所有項目{...存儲庫{...行家{網址https://maven.google.com/"}}}

然后也在同一個 build.gradle 文件中的 android 部分:

project(":android") {...依賴{...編譯'com.google.android.gms:play-services-ads:11.2.0'}}

這兩行足以讓 Gradle 同步沒有問題.除了已經默認添加到我的 libGDX 項目中的插件之外,我不需要添加任何插件.

在那之后,我得到了一些不同的錯誤,但沒有關于 Gradle 或依賴項的錯誤.簡而言之,JFTR:

首先,我的 minSdkVersion 為 8.通過將其提高到 14 來解決.我想我可以不支持所有低于 14 的設備.

其次,我遇到了 dex 引用上限的問題.我以前從未遇到過這個問題,但也許你已經注意到我使用的解決方案:我沒有編譯整個 'com.google.android.gms:play-services' 我只使用了 'com.google.android.gms:play-services-ads' 這是我現在真正感興趣的 API.對于像這樣的解決方案可能沒有用的其他特殊情況,本文檔可以提供一些更好的見解:https://developer.android.com/studio/build/multidex.html

第三,即使在那之后,我在此處描述并回答了這個巨型"問題:https://stackoverflow.com/a/26248495/1160360

就是這樣.到目前為止,一切都建立起來了,我的游戲終于顯示了那些 Admob 橫幅.

我在這方面花了好幾個小時,我想,這讓我想知道我們最近使用的所有這些樓宇自動化系統是否值得它們增加的額外負載.

我的意思是,大約五年前我第一次將 Admob 添加到應用程序時,我只需要下載一個 .jar 文件并將其放在我項目的目錄中.很明顯,從谷歌搜索如何在我的 android 項目中設置 Admob"到讓我的應用顯示 Admob 橫幅的整個過程只花了我幾分鐘.我將把它留在這里,因為這里不是這種辯論的地方.

不過,我希望我自己的經驗對其他人有用.

I'm trying to add google play services to my libGDX project in IntelliJ Idea. I've followed the setup guide here: https://developers.google.com/android/guides/setup

which looks pretty straightforward. I just added those lines to my build.gradle in the corresponding section, so things look now like:

project(":android") {
    apply plugin: "android"
    apply plugin: 'com.android.application'

    configurations { natives }

    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
        compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
        compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
        compile 'com.google.android.gms:play-services:11.2.0'
    }
}

Then I try to sync my gradle project in Idea just to get that "Failed to resolve" error.

Well, the setup guide also says "Be sure you update this version number each time Google Play services is updated", but the problem is that it seems nearly impossible to find that version number: my Google Play Services SDK version according to the Android SDK manager is "43", and so far I have been unable to correlate such "11.2.0" or whatever typical version string with the "43" version number. Not that the setup guide says nothing about that.

Anyway, I have tried a lot of things from the plethora of questions related to this to no avail. Specifically, I have to point out that I do have my Android SDK properly updated and I'm sure it is the one it's being used by Idea (I've already triple-checked this...):

I'm using the API level 26, but anyway the other defines do use the very same directory for the Android SDK. Moreover, I do NOT have any other android SDK installed at all in this laptop, so there's no question about Idea being using that one and that one only.

Any ideas are more than welcome.

Thanks in advance!

解決方案

I just replaced version 11.2.0 with 11.0.0 and then it seemed to work fine, so that had to mean that 11.2.0 wasn't included with the latest Android SDK.

So, after struggling with all the available scattered documentation, I reached this document by pure chance (I guess it is not indexed high enough by Google): https://developers.google.com/android/guides/releases

I quote from there:

Highlights from the Google Play services 11.2 release. Google Play services dependencies are now available via maven.google.com

Now, even when that shouldn't necessarily mean that they are not available with the downloaded SDK anymore, it seems that this is actually the case.

Anyway, adding google() to my build.gradle didn't work (not found, undefined, or whatever...), so I used a different approach that I found in this document referenced from the previous one:

https://developer.android.com/studio/build/dependencies.html#google-maven

I modified my build.gradle file adding that line to allprojects/repositories, as in:

allprojects {
...
    repositories {
...
        maven { url "https://maven.google.com/"}
    }
}

And then also in the android section in the same build.gradle file:

project(":android") {
...
    dependencies {
...
        compile 'com.google.android.gms:play-services-ads:11.2.0'
    }
}

Those two lines were enough to make Gradle sync without problems. I didn't need to add any plugins apart from the ones that are already added in my libGDX project by default.

After that, I got a few different errors, but none about Gradle or dependencies. In a brief, JFTR:

First, I had a minSdkVersion of 8. Solved by raising it to 14. I think I could live without supporting all those devices below 14.

Second, I had problems with the dex upper limit of references. I've never faced this problem before, but maybe you've already noticed the solution I used: instead of compiling the whole 'com.google.android.gms:play-services' I used only 'com.google.android.gms:play-services-ads' that's the API I'm actually interested right now. For those other particular cases where a solution like this may not be useful, this document could provide some better insight: https://developer.android.com/studio/build/multidex.html

Third, even after that I got this "jumbo" thing problem described and answered here: https://stackoverflow.com/a/26248495/1160360

And that's it. As of now, everything builds and my game does finally shows those Admob banners.

I've spent hours with this, thought, which makes me wonder if all these building automation systems we are using lately are worth the extra load they add.

I mean, the first time I had to add Admob to an app five years ago or so, I just had to download a .jar file and put it on a directory on my project. It was pretty obvious and the whole process, from googling "how to setup Admob in my android project" to have my app showing an Admob banner took me just a few minutes. I'm gonna leave it here, since this is not the place for such kind of debate.

Nonetheless, I hope my own experience is useful for someone else further.

這篇關于無法解決:帶有 gradle 的 IntelliJ Idea 中的 com.google.android.gms:play-services的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Parsing an ISO 8601 string local date-time as if in UTC(解析 ISO 8601 字符串本地日期時間,就像在 UTC 中一樣)
How to convert Gregorian string to Gregorian Calendar?(如何將公歷字符串轉換為公歷?)
Java: What/where are the maximum and minimum values of a GregorianCalendar?(Java:GregorianCalendar 的最大值和最小值是什么/在哪里?)
Calendar to Date conversion for dates before 15 Oct 1582. Gregorian to Julian calendar switch(1582 年 10 月 15 日之前日期的日歷到日期轉換.公歷到儒略歷切換)
java Calendar setFirstDayOfWeek not working(java日歷setFirstDayOfWeek不起作用)
Java: getting current Day of the Week value(Java:獲取當前星期幾的值)
主站蜘蛛池模板: 国产 亚洲 网红 主播 | 97超在线视频 | 99精品在线 | 成人av网站在线观看 | 在线看av网址 | 在线天堂免费中文字幕视频 | 欧美不卡 | 一区二区av | 琪琪午夜伦伦电影福利片 | 精品乱码一区二区三四区 | av在线免费网| 91精品久久久久久久久久入口 | 在线精品一区二区三区 | 国产精品久久久久久久久久久久久 | 欧美一级大片免费观看 | 性一区 | 欧美在线不卡 | 在线看日韩 | 黄色在线免费观看 | 在线免费看黄 | 欧美一区二区视频 | 日韩精品一区二区在线 | 999热视频 | 久久精品国产99国产 | 日韩中文视频 | 日韩三级免费观看 | 91视频免费| 日韩精品一区二区三区中文在线 | 男人天堂手机在线视频 | 国产精品日韩欧美一区二区三区 | 国产精品a久久久久 | 国产精品日韩在线观看一区二区 | 性色av一区二区三区 | 午夜私人影院 | 五月天国产在线 | 一级看片| 日日操夜夜干 | www.色婷婷 | 一本久久a久久精品亚洲 | 国产精品久久久久aaaa樱花 | 在线观看三级av |