2016-07-27 26 views
0

我嘗試添加admob橫幅但遇到此錯誤,該怎麼辦?如何修復模塊中的錯誤取決於一個或多個Android庫,但是是一個jar嗎?

buildscript { 
repositories { 
    mavenLocal() 
    mavenCentral() 
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:2.1.2' 
    classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.1.0' 
    classpath 'com.google.gms:google-services:3.0.0' 
} 

}

allprojects { 應用插件: 「月蝕」 應用插件: 「理念」

version = '1.0' 
ext { 
    appName = "my-gdx-game" 
    gdxVersion = '1.9.3' 
    roboVMVersion = '2.1.0' 
    box2DLightsVersion = '1.4' 
    ashleyVersion = '1.7.0' 
    aiVersion = '1.8.0' 
    admobVersion = '9.2.0' 
} 

repositories { 
    mavenLocal() 
    mavenCentral() 
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 
    maven { url "https://oss.sonatype.org/content/repositories/releases/" } 
} 

}

項目( 「:桌面」){ 申請插件:「java」

dependencies { 
    compile project(":core") 
    compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" 
    compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" 
} 

}

項目( 「:機器人」){ 應用插件: 「Android」 的

configurations { natives } 

dependencies { 
    compile project(":core") 
    compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64" 
    compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64" 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
} 

}

項目( 「:IOS」){ 應用插件: 「Java」 的 應用插件: 「robovm」

dependencies { 
    compile project(":core") 
    compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion" 
    compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion" 
    compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios" 
    compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios" 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
} 

}

項目( 「:核心」){ 應用插件: 「Java」 的

dependencies { 
    compile "com.badlogicgames.gdx:gdx:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" 
    compile fileTree(dir: '../libs', include: '*.jar') 
    compile "com.google.android.gms:play-services-ads:$admobVersion" 
} 

}

tasks.eclipse.doLast { 刪除 「的.project」 } enter image description here

回答

1

您正在嘗試編譯adMob組件:

(com.google.android.gms:播放服務的廣告:$ admobVersion)

在覈心模塊(被編譯成一個JAR庫)!

你需要將它移動到Android模塊(這將被編譯爲一個AAR - Android檔案庫)。

相關問題