我正在尝试将MoPub SDK添加到我的libgdx游戏中。我使用了Gradle集成,看起来很好用。但是我无法使用新的MoPub()对象提供给Fabric。我使用的是Android Studio 1.2.1.1,并遵循https://github.com/mopub/mopub-android-sdk的要求。
Fabric.with(this, new Crashlytics(), new MoPub());
Android Studio中的返回值:
Error:(89, 15) error: method with in class Fabric cannot be applied to given types;
required: Context,Kit[]
found: AndroidLauncher,Crashlytics,MoPub
reason: varargs mismatch; MoPub cannot be converted to Kit
由于某些原因,MoPub对象未被识别为正确的类型。我不知道为什么。
这是我的gradle文件的样子:
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
configurations { natives }
dependencies {
compile project(":core")
compile files('libs/mopub-volley-1.1.0.jar')
compile files('libs/android-support-v7-recyclerview.jar')
compile files('libs/annotations-4.1.1.4.jar')
compile files('libs/android-support-v4.jar')
compile('com.mopub:mopub-sdk:4.0.0@aar') {
transitive = true
}
compile('com.crashlytics.sdk.android:crashlytics:2.2.2@aar') {
transitive = true;
}