如何在android studio中添加Mopub广告

xxls0lw8  于 2022-12-27  发布在  Android
关注(0)|答案(1)|浏览(172)

我正在尝试将Mopub广告集成到我的Android Studio项目中,但在构建项目时遇到错误。我已按照链接(https://developers.mopub.com/publishers/android/integrate/#option-3-cloned-github-repository)中提供的说明操作,但仍不确定如何解决该错误。错误消息为:
原因:org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method implementation() for arguments [com.mopub:mopub-sdk:@aar, build_2jh7i72qxdht1wclzb0v2ink0$_run_closure1$_closure3$_closure5@13b54e85] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
以下是我的build.gradle文件以供参考:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        jcenter()
        google()
        maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.3'
        classpath 'com.google.gms:google-services:4.3.3'
        implementation('com.mopub:mopub-sdk:@aar') {
            transitive = true
        }
        // NOTE: Do not place your application dependencies here; they belon
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
       
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
cwtwac6a

cwtwac6a1#

implementation('com.mopub:mopub-sdk:5.13.1@aar')将进入应用(而非项目)的build.gradle

相关问题