gpt4 book ai didi

java - 如何修复模块中的错误取决于一个或多个Android库但是是一个jar?

转载 作者:行者123 更新时间:2023-11-30 10:41:07 25 4
gpt4 key购买 nike

我尝试添加 admob 横幅但遇到此错误,该怎么办?

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'
}

所有项目{ 应用插件:“eclipse” 应用插件:“想法”

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

最佳答案

您正在尝试编译 adMob 组件:

(com.google.android.gms:play-services-ads:$admobVersion)

关于核心模块(即编译成jar库)!

您需要将其移动到 Android 模块(这将被编译为 AAR - Android 存档库)。

关于java - 如何修复模块中的错误取决于一个或多个Android库但是是一个jar?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38621585/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com