【问题标题】:Flutter App Integrating AdColony with MediationFlutter App 将 AdColony 与中介集成
【发布时间】:2020-06-11 13:08:48
【问题描述】:

使用 Flutter 设置 AdMob 中介时 (firebase_admob: ^0.9.3+2) 我收到以下错误

注意:我已成功设置 ADmob 集成

我遵循此处提到的所有步骤: Integrating AdColony with Mediation

按照第 3 步,这是我的 app/build.gradle 文件

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

    implementation 'com.google.ads.mediation:adcolony:4.1.4.1'

}

错误

      FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[17.0.
  0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.android.gms:play-services-measurement-api:17.0.0 -> com.google.android.gms:play-services-
  measurement-sdk-api@[17.0.0], but play-services-measurement-sdk-api version was 17.1.0.

  The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
  ifact with the issue.
  -- Project 'app' depends on project 'firebase_admob' which depends onto com.google.firebase:firebase-ads@18.1.1
  -- Project 'app' depends onto com.google.firebase:firebase-analytics@{strictly 17.0.0}
  -- Project 'app' depends onto com.google.android.gms:play-services-ads@{strictly 19.0.1}
  -- Project 'app' depends on project 'firebase_analytics' which depends onto com.google.firebase:firebase-analytics@16.5.
  0
  -- Project 'app' depends onto com.google.ads.mediation:adcolony@4.1.4.1
  -- Project 'app' depends onto com.google.android.gms:play-services-gass@{strictly 19.0.1}
  -- Project 'app' depends onto com.google.android.gms:play-services-measurement-sdk-api@{strictly 17.1.0}
  -- Project 'app' depends onto com.google.firebase:firebase-ads@{strictly 18.1.1}
  -- Project 'app' depends onto com.google.android.gms:play-services-measurement-api@{strictly 17.0.0}
  -- Project 'app' depends onto com.google.android.gms:play-services-measurement-sdk@{strictly 17.0.0}
  -- Project 'app' depends onto com.google.ads.mediation:adcolony@{strictly 4.1.4.1}
  -- Project 'app' depends onto com.google.android.gms:play-services-ads-lite@{strictly 19.0.1}

  For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
  endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
  github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
  uild.gradle file.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 51s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Found this github issue Upgrade SDK version from 18.1.1 to 19.1.0

【问题讨论】:

    标签: flutter adcolony firebase-admob


    【解决方案1】:

    更改版本后我能够编译代码

    这是我用于 firebase 的 pubspec.yaml:

      #Firebase libary
      firebase_core: ^0.4.5
      cloud_firestore: ^0.13.6
      firebase_auth: ^0.16.1
      firebase_remote_config: ^0.3.1
      firebase_dynamic_links: ^0.5.1
      firebase_crashlytics: ^0.1.3+3
      firebase_messaging: ^6.0.16
      firebase_admob: ^0.9.3+2
      firebase_analytics: ^5.0.15
    

    和 android/app/build.gradle

    dependencies {
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test:runner:1.1.1'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    
        implementation 'com.google.ads.mediation:adcolony:4.1.0.0' //latest version 4.1.4.1 not compatible with firebase_admob 0.9.3+2
    }
    

    com.google.ads.mediation.adcolony releases

    【讨论】:

      【解决方案2】:

      我没有降级 AdColony 中介适配器,而是通过手动编辑文件“flutter.pub-cache\hosted\pub.dartlang.org\firebase_admob-0.9.3+2\android\build.gradle ",因此它获取了最新版本的 Admob Android SDK:

      android {
          dependencies {
              api 'com.google.firebase:firebase-ads:19.1.0'
          }
      }
      

      一个月前我在 Play Store 上发布了这个,对于一个拥有大约 100.000 MAU 的应用程序,到目前为止没有任何问题...

      【讨论】:

      • 感谢埃内斯托。这是一个本地缓存,所以这意味着您需要在安装软件包后手动执行它吗?
      猜你喜欢
      • 1970-01-01
      • 2021-02-26
      • 2019-07-21
      • 2020-08-09
      • 1970-01-01
      • 2021-06-23
      • 1970-01-01
      • 2020-04-18
      • 1970-01-01
      相关资源
      最近更新 更多