gpt4 book ai didi

android - Gradle 找不到依赖项 com.google.android.gms :play-services

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:22:34 27 4
gpt4 key购买 nike

自从我将 Android Studio 升级到 3.0.0 后,我遇到了一个问题:我再也找不到 com.google.android.gms:play-services 了!

添加此依赖项后,当我尝试同步我的项目时,我收到此消息:

Failed to resolve: com.google.android.gms:play-services-games:11.4.2

我可以点击“安装存储库和同步项目”,但是当我点击时,我收到这条消息:

Could not find dependency "com.google.android.gms:play-services-games:11.4.2"

我尝试搜索,但我找到的唯一解决方案是安装 Google 存储库,并将 jcenter() 添加到我的 build.gradle 文件中的存储库但我已经做到了!

有什么想法吗?

这是我的 build.gradle 文件:

buildscript {


repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1'


}
}

allprojects {
apply plugin: "eclipse"
apply plugin: "idea"

version = '1.0'
ext {
appName = "Glowee"
gdxVersion = '1.9.7'
roboVMVersion = '2.3.1'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
aiVersion = '1.8.0'
}

repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}

project(":desktop") {
apply plugin: "java"


dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"

}
}

project(":android") {
apply plugin: "android"

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-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-games:11.4.2"
compile "com.google.android.gms:play-services-ads:11.4.2"
compile "com.google.android.gms:play-services-plus:11.4.2"

}
}

project(":ios") {
apply plugin: "java"
apply plugin: "robovm"


dependencies {
compile project(":core")
compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"

compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"

}
}

project(":core") {
apply plugin: "java"


dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"

compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"

}
}

tasks.eclipse.doLast {
delete ".project"
}

最佳答案

我通过在 build.gradle 项目模块中添加 google() 存储库解决了这个问题

enter image description here

关于android - Gradle 找不到依赖项 com.google.android.gms :play-services,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46953881/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com