错误':android:transformKotlinClassesWithJillForDebug'。在构建用Kotlin + LibGDX编写的Android应用程序时

时间:2017-10-25 14:57:23

标签: android gradle build libgdx kotlin

我正在使用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"
 }

也许我应该发布更多代码。我不知道还有什么可以帮到你。只需写评论,我会告诉你你需要什么。我从来没有遇到过这样的问题。谷歌也没有帮助。

1 个答案:

答案 0 :(得分:1)

首先,您需要将Kotlin版本1.1.1更新为1.1.51

而不是在android依赖标记中添加kotlin-stdlib工件。

compile "org.jetbrains.kotlin:kotlin-stdlib:1.1.51"