我正在使用 LibGDX 框架在 Kotlin 上开发游戏。我在构建 Android 应用程序时遇到问题。桌面和 IOS(moe-framework)构建良好。
这是完整的消息:
Error:A problem was found with the configuration of task ':android:transformKotlinClassesWithJillForDebug'.
> File '/Users/maximternovtsi/bagel/android/build/tmp/kotlin-classes/debug.jar' specified for property 'inputJarFile' does not exist.
我的
build.gradle
文件: buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'org.multi-os-engine:moe-gradle:1.3.6'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.1"
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = "Bagel"
gdxVersion = '1.9.6'
}
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url "https://oss.sonatype.org/content/repositories/releases/"
}
}
}
project(":desktop") {
apply plugin: "kotlin"
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"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
}
}
project(":android") {
apply plugin: "android"
apply plugin: "kotlin-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"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
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"
}
}
project(":core") {
apply plugin: "kotlin"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
compile "org.jetbrains.kotlin:kotlin-stdlib:1.1.1"
compile "com.badlogicgames.ashley:ashley:1.7.0"
// compile 'com.esotericsoftware:kryonet:2.22.0-RC1'
// compile 'io.netty:netty-all:4.1.13.Final-SNAPSHOT'
}
}
project(":ios-moe") {
apply plugin: "moe"
configurations {
natives
}
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-moe:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
}
}
tasks.eclipse.doLast {
delete ".project"
}
也许我应该发布更多代码。我不知道还有什么可以帮助你的。只需写一个评论,我会告诉你你需要什么。我从来没有遇到过这样的问题。谷歌也没有帮助。
最佳答案
首先,您需要更新 Kotlin 版本 1.1.1
至1.1.51
比添加 kotlin-stdlib
android依赖标签中的工件。
compile "org.jetbrains.kotlin:kotlin-stdlib:1.1.51"
关于android - 错误 ':android:transformKotlinClassesWithJillForDebug' 。在构建用 Kotlin + LibGDX 编写的 Android 应用程序时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46935735/