【问题标题】:HMS Ads Kit - Could not resolve com.huawei.hms:ads-lite:13.4.29.303HMS Ads Kit - 无法解析 com.huawei.hms:ads-lite:13.4.29.303
【发布时间】:2020-08-14 19:00:20
【问题描述】:
实际上我正在尝试实施广告,但我在 codelab 的指导下做了所有事情,但显示此消息....如何解决此问题。??
错误:无法解析 ':app@debugUnitTest/compileClasspath' 的依赖关系:无法解析 com.huawei.hms:ads-lite:13.4.29.303。
谢谢
【问题讨论】:
标签:
huawei-mobile-services
huawei-developers
【解决方案1】:
你是否在你的 app build.gradle 中添加了这个插件?
apply plugin: 'com.huawei.agconnect
还要确保您在顶级 build.gradle 中添加了以下代码
buildscript {
repositories {
google()
jcenter()
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
classpath 'com.huawei.agconnect:agcp:1.2.1.301'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://developer.huawei.com/repo/' }
}
}