【问题标题】: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/' }
  }
}

【讨论】:

    【解决方案2】:

    请验证您的顶级 build.gradle 如下所示:

    enter image description here

    之后,确认您没有使用代理设置:

    转到设置 -> 外观和行为 -> 系统设置 ->HTTP 代理

    最后转到 File-> Invalidate Caches / Restart

    enter image description here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-28
      • 1970-01-01
      • 1970-01-01
      • 2016-11-02
      • 2020-08-29
      • 1970-01-01
      • 1970-01-01
      • 2021-04-06
      相关资源
      最近更新 更多