rakesh
rakesh

Reputation: 285

Generate APK File From Ubuntu Terminal Gradle Build

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }

    defaultConfig {
        applicationId "com.example.takeimage"
        minSdkVersion 19
        targetSdkVersion 23
    }

    android {
        packagingOptions {
            exclude 'META-INF/NOTICE'
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.4.2'
    compile 'org.glassfish.main:javax.annotation:4.0-b33'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:23.1.1'

}
  1. This is My Build.Gradle file of my project.
  2. Here I'm trying to generate apk file from ubuntu terminal using gradle build.
  3. But the Gradle Build Failed........
  4. I Don't have Android Studio
  5. I have only Android sdk.
  6. My main task is to generate apk file with out launching android studio.
  7. From terminal
  8. ./gradlw assemble Debug using this cmd.
  9. Here is my log........

BUILD FAILED

  1. Can any one help me to solve this issue.
  2. I'm very much thankful to you.........

Upvotes: 0

Views: 1204

Answers (3)

atroutt
atroutt

Reputation: 471

It looks like you need some support libraries locally. Have you tried running this once from the terminal?

android update sdk --no-ui --all --filter tool,extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository,android-23

Upvotes: 0

rakesh
rakesh

Reputation: 285

Most likely you have a 64bit system and still some 32bits are missing for android development.

If you're running on a 64bit-Ubuntu system, see 32-bit-libs for Ubuntu 64-bit Android Development for further details.

If you're running on a 64bit-Fedora system, see installing-android-sdk-on-64-bit-fedora/ for further details.

To get aapt working (this fixed my issues with the avd as well) just run these two commands: sudo apt-get install lib32stdc++6 sudo apt-get install lib32z1

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1006584

You do not have the Android Repository and Google Repository installed in your SDK Manager, or they are not up to date with the latest updates.

Upvotes: 1

Related Questions