我目前正在使用Google Admob在我的应用程序中显示广告,我想添加中介,因为我对我的填充率不满意。我按照他们在网站上的步骤,通过调解整合Adcolony。我添加了adcolony.jar文件,并使用Android Studio将其与Gradle同步。在集成过程中,我在应用程序级别的build.gradle、中添加了这些行
repositories {
jcenter()
maven {
url "https://adcolony.bintray.com/AdColony"
}
}
...
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.gms:play-services-ads:19.0.0'
implementation 'com.google.ads.mediation:adcolony:4.1.3.1'
}
...
运行应用程序后,调试控制台会抛出以下错误:
Duplicate class com.iab.omid.library.adcolony.walking.a.e found in modules jetified-adcolony.jar (adcolony.jar) and jetified-sdk-4.1.3-runtime.jar (com.adcolony:sdk:4.1.3)
Duplicate class com.iab.omid.library.adcolony.walking.a.f found in modules jetified-adcolony.jar (adcolony.jar) and jetified-sdk-4.1.3-runtime.jar (com.adcolony:sdk:4.1.3)
Duplicate class com.iab.omid.library.adcolony.walking.b found in modules jetified-adcolony.jar (adcolony.jar) and jetified-sdk-4.1.3-runtime.jar (com.adcolony:sdk:4.1.3)
Duplicate class com.iab.omid.library.adcolony.walking.c found in modules jetified-adcolony.jar (adcolony.jar) and jetified-sdk-4.1.3-runtime.jar (com.adcolony:sdk:4.1.3)
Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
* 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
Gradle task assembleDebug failed with exit code 1
我已经缩短了我的错误,但主要是因为发现了重复的类,我不知道如何在我的build.gradle中排除这么多类。请帮忙。
要集成广告中介,您需要按照网站上提到的所有步骤操作,但不是使用build.gradle,而是我从adcolony repo手动添加了适配器。Google Admob中介网站已过时,请使用此链接了解如何集成广告适配器。
https://github.com/AdColony/AdColony-Android-SDK/wiki/Project-Setup