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?

1
  • 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. Commented Jul 30, 2015 at 7:34

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.