-1
我在引用這個https://github.com/mopub/mopub-android-sdk/wiki/Getting-Started來將mopub集成到我的應用中。我在我的項目的build.gradle文件中添加mopub-sdk依賴項時出現錯誤「找不到方法編譯參數」。請幫助我。 的build.gradle文件:Gradle Sync失敗:找不到方法compile()參數
buildscript {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}}
allprojects {
repositories {
jcenter()
}
dependencies {
compile('com.mopub:mopub-sdk:[email protected]') {
transitive = true
}
// For banners
compile('com.mopub:mopub-sdk-banner:[email protected]') {
transitive = true
}
// For interstitials
compile('com.mopub:mopub-sdk-interstitial:[email protected]') {
transitive = true
}
// For rewarded videos. This will automatically also include
interstitials
compile('com.mopub:mopub-sdk-rewardedvideo:[email protected]') {
transitive = true
}
// For native static (images).
compile('com.mopub:mopub-sdk-native-static:[email protected]') {
transitive = true
}
// For native video. This will automatically also include native static
compile('com.mopub:mopub-sdk-native-video:[email protected]')
{transitive = true}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
實際誤差: -
Error:(31, 0) Could not find method compile() for arguments [com.mopub:mopub-sdk:[email protected], bu[email protected]1c36532] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.