Plugin with id ‘com.google.gms.google-services‘ not found.

本文介绍了解决在Android Studio中遇到的'com.google.gms.google-services'插件未找到的问题,通常在模块级的build.gradle文件中应用此插件后出现。解决方案涉及在项目级的build.gradle文件的dependencies部分添加正确的版本号。

Plugin with id ‘com.google.gms.google-services’ not found.

我最近修改了点东西,然后提示我审核未通过,这玩意是干嘛的你都不清楚,我也是醉了


问题:
android studio报错 Plugin with id 'com.google.gms.google-services' not found
这个是在模块级下的build.gradle加入apply plugin:'com.google.gms.google-services'后出现的

解决方法:
在项目级别的build.gradle的dependencies加入如下,后面的x.x.x是版本,我目前用的是4.2.0,有的会报ASCII的错误,挑个正确的版本就好了

buildscript {
  dependencies {
      classpath 'com.google.gms:google-services:x.x.x'
  }
}

维尼聚合工具


关于Google Play services的各个分支介绍(MX5一定要安装XXXXXX-448分支) 要想使用google play, google map等google应用,就必须安装Google Play Service,但Google Play Service有太多分支了,最近终于搞明白各个分支代表什么。 版本号最后三位(2104405-XYZ)分别表示Android版本,cpu的arm系列,屏幕密度(DPI)。 下面是具体分支介绍: Notes / What's New Uploader's notes: To figure out the right version of Google Play services for your Android device, go to Settings -> Apps -> Google Play services, and look at the last 3 numbers in the parentheses. You'll see something like -XYZ where: 1.第一位X * X defines Android version: 0 for Android =5.0 // 4和7表示Android5.0及以上 8 for Android TV // 8表示Android电视应用 2.第二位Y * Y defines CPU architecture: 1 for armeabi 3 for armeabi-v7a // 32位版本 4 for arm64-v8a // 64位v8版本,MX5必须是这个 7 for x86 // x86主要是对intel cpu来说的 3.第三位Z * Z defines DPI: 0 for universal 2 for 160 4 for 240 6 for 320 8 for 480 // MX5选这个就行了 Notes: It seems that -7YZ builds became -4YZ with Google Play services 6.5. If you were on -7YZ before, you should now install -4YZ. Looks like -8YZ builds are for Android TV. Examples: -014 for Android <5.0 armeabi CPU 240 DPI device -438 for Android 5.0+ armeabi-v7a CPU 480 DPI device -876 for Android TV x86 CPU 320 DPI device 国内用户可以直接从以下镜像网站下载最新到Google Play Service http://www.apkmirror.com/apk/google-inc/google-play-services/ 目前最新版本是Google Play services 7.8.93 MX5用户可以安装以下分支: Google Play services 7.8.93 (2104405-448) http://www.apkmirror.com/apk/google-inc/google-play-services/google-play-services-7-8-93-2104405-448-android-apk-download/ 另外,安装后好需要禁止系统自带【应用中心】自动安装更新,可以设置面流量更新,但不要设置“静默安装更新包”,否则新版本发布后会自动更新成应用中心的最新版本,而最新版本的后三位可能不是你想要的分支,这时候就会导致弹出提示架构不符等。
A problem occurred configuring root project 'juancashforex'. > Could not resolve all files for configuration ':classpath'. > Could not resolve com.android.tools.build:gradle:7.4.2. Required by: project : project : > com.android.application:com.android.application.gradle.plugin:7.4.2 project : > com.android.library:com.android.library.gradle.plugin:7.4.2 > No matching variant of com.android.tools.build:gradle:7.4.2 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.4.2' but: - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2') - Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2') - Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2') - Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2') > Could not resolve com.google.gms:google-services:4.4.2. Required by: project : > com.google.gms.google-services:com.google.gms.google-services.gradle.plugin:4.4.2 > No matching variant of com.google.gms:google-services:4.4.2 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.4.2' but: - Variant 'apiElements' capability com.google.gms:google-services:4.4.2 declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2') - Variant 'javadocElements' capability com.google.gms:google-services:4.4.2 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2') - Variant 'runtimeElements' capability com.google.gms:google-services:4.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2') - Variant 'sourcesElements' capability com.google.gms:google-services:4.4.2 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
08-21
Could not determine the dependencies of task ':unityLibrary:compileReleaseAidl'. > Could not resolve all task dependencies for configuration ':unityLibrary:releaseCompileClasspath'. > Could not resolve com.google.guava:guava:33.0.0-android. Required by: project :unityLibrary > Cannot choose between the following variants of com.google.guava:guava:33.0.0-android: - androidApiElements - jreApiElements All of them match the consumer attributes: - Variant 'androidApiElements' capabilities com.google.collections:google-collections:33.0.0-android and com.google.guava:guava:33.0.0-android: - Unmatched attributes: - Required com.android.build.api.attributes.BuildTypeAttr 'release' but no value provided. - Found org.gradle.category 'library' but wasn't required. - Found org.gradle.dependency.bundling 'external' but wasn't required. - Found org.gradle.jvm.environment 'android' but wasn't required. - Found org.gradle.jvm.version '8' but wasn't required. - Found org.gradle.libraryelements 'jar' but wasn't required. - Found org.gradle.status 'release' but wasn't required. - Compatible attribute: - Required org.gradle.usage 'java-api' and found compatible value 'java-api'. - Variant 'jreApiElements' capabilities com.google.collections:google-collections:33.0.0-android and com.google.guava:guava:33.0.0-android: - Unmatched attributes: - Required com.android.build.api.attributes.BuildTypeAttr 'release' but no value provided. - Found org.gradle.category 'library' but wasn't required. - Found org.gradle.dependency.bundling 'external' but wasn't required. - Found org.gradle.jvm.environment 'standard-jvm' but wasn't required. - Found org.gradle.jvm.version '8' but wasn't required. - Found org.gradle.libraryelements 'jar' but wasn't required. - Found org.gradle.status 'release' but wasn't required. - Compatible attribute: - Required org.gradle.usage 'java-api' and found compatible value 'java-api'. > Could not find :applovin-max-unity-plugin:. Required by: project :unityLibrary > Could not find :CopyPastePlugin-debug:. Required by: project :unityLibrary > Could not find :UnityAds:. Required by: project :unityLibrary > Could not resolve com.google.guava:guava:33.0.0-android. Required by: project :unityLibrary > androidx.media3:media3-common:1.4.1 > Cannot choose between the following variants of com.google.guava:guava:33.0.0-android: - androidApiElements - jreApiElements All of them match the consumer attributes: - Variant 'androidApiElements' capabilities com.google.collections:google-collections:33.0.0-android and com.google.guava:guava:33.0.0-android: - Unmatched attributes: - Required com.android.build.api.attributes.BuildTypeAttr 'release' but no value provided. - Found org.gradle.category 'library' but wasn't required. - Found org.gradle.dependency.bundling 'external' but wasn't required. - Found org.gradle.jvm.environment 'android' but wasn't required. - Found org.gradle.jvm.version '8' but wasn't required. - Found org.gradle.libraryelements 'jar' but wasn't required. - Found org.gradle.status 'release' but wasn't required. - Compatible attribute: - Required org.gradle.usage 'java-api' and found compatible value 'java-api'. - Variant 'jreApiElements' capabilities com.google.collections:google-collections:33.0.0-android and com.google.guava:guava:33.0.0-android: - Unmatched attributes: - Required com.android.build.api.attributes.BuildTypeAttr 'release' but no value provided. - Found org.gradle.category 'library' but wasn't required. - Found org.gradle.dependency.bundling 'external' but wasn't required. - Found org.gradle.jvm.environment 'standard-jvm' but wasn't required. - Found org.gradle.jvm.version '8' but wasn't required. - Found org.gradle.libraryelements 'jar' but wasn't required. - Found org.gradle.status 'release' but wasn't required. - Compatible attribute: - Required org.gradle.usage 'java-api' and found compatible value 'java-api'. Unity 打包安卓出现这个错误,请帮我解决
最新发布
11-28
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值