[英]Android compile loop after added .jar files which use java 8
I need to use same nlp libraries in my android application. 我需要在我的android应用程序中使用相同的nlp库。 In particular these libraries need java 8. I added the .jar files in android project, added
特别是这些库需要java 8.我添加了android项目中的.jar文件
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
到app.grandle,但是当我运行项目时,Grandle控制台进入循环
:app:transformClassesWithPreJackPackagedLibrariesForDebug
Try Compiling it with making gradle offline 尝试使gradle脱机进行编译
Fixed it by going to Android Studio -> Preferences -> Gradle -> and ticking Offline work. 通过转到Android Studio - >首选项 - > Gradle - >并勾选脱机工作来修复它。 at least now it will run.
至少现在它会运行。
Edit: In new Android Studio Versions the path is File -> Other Settings -> Default Settings -> Build-Excecution-Deployment -> Gradle 编辑:在新的Android Studio版本中,路径为文件 - >其他设置 - >默认设置 - >构建 - 执行 - 部署 - > Gradle
One more thing, please do check the the .jar file also. 还有一件事,请检查.jar文件。 sometimes the source you downlaod the jar file is not accurate and some files missing in your jar file cause errors.
有时你下载jar文件的源是不准确的,你的jar文件中缺少一些文件会导致错误。 this happened to me once when i was working on java project.
当我在java项目上工作时,这发生在我身上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.