9

I have created a Jar of a project written in Kotlin language. Jar contains following folders :

com
jet
kotlin
meta-inf
okio
org

Then I created an android project and added Kotlin and the Jar as dependency.

When I try to execute the hello world app it throws following exception.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with non-zero exit value 1

My app build gradle file is

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "abc.xyz.kotlin"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    compile files('libs/xyz.jar')
}
buildscript {
    ext.kotlin_version = '0.12.1218'
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
repositories {
    mavenCentral()
}

Can you please help me to resolve this issue?

Lamorak
  • 10,957
  • 9
  • 43
  • 57
manish
  • 944
  • 2
  • 14
  • 27
  • Try build your app from command-line something like: "./gradlew assembleDebug --stacktrace --debug". It should give us more info about the error. Remember to change the task name with that one which you're using to build the project. – klimat Jul 30 '15 at 07:34

1 Answers1

7

My Jar was containing Kotlin runtime and I configured Kotlin in my android project also. These two Kotlin configuration were causing problem. After removing Kotlin from my Jar it started working.

manish
  • 944
  • 2
  • 14
  • 27