1

I need to use same nlp libraries in my android application. In particular these libraries need java 8. I added the .jar files in android project, added

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.example.kekko.nlp_api_25"
        minSdkVersion 25
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        jackOptions {
            enabled true
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

to the app.grandle, but when I run the project, the Grandle console go in loop with :app:transformClassesWithPreJackPackagedLibrariesForDebug

Cœur
  • 37,241
  • 25
  • 195
  • 267
Invictus
  • 426
  • 3
  • 13

1 Answers1

0

Try Compiling it with making gradle offline

Fixed it by going to Android Studio -> Preferences -> Gradle -> and ticking Offline work. at least now it will run.

Edit: In new Android Studio Versions the path is File -> Other Settings -> Default Settings -> Build-Excecution-Deployment -> Gradle

One more thing, please do check the the .jar file also. sometimes the source you downlaod the jar file is not accurate and some files missing in your jar file cause errors. this happened to me once when i was working on java project.

S.Kumar
  • 1
  • 3
  • i think the jar is ok because when i compile it whith java ide it work!! I have this problem only on adroid – Invictus Jan 15 '17 at 22:23
  • if it's working with java and not working with android please do check it's compatibility with Dalvik Virtual Machine, that could be a problem – S.Kumar Jan 15 '17 at 22:31
  • https://developer.android.com/topic/libraries/support-library/index.html – S.Kumar Jan 15 '17 at 22:45
  • check this link that i shared here you can check which libraries are compatible with android – S.Kumar Jan 15 '17 at 22:46