我创建了一个Android项目,并在我的项目中添加了一个外部JAR(hessian-4.0.1.jar).然后我将JAR添加到构建路径并在Order和Export中将其检出.
看起来忽略了Order和Export,并且运行时缺少外部JAR中的所有类.
在使用Eclipse插件构建Android应用程序时,是否有从外部JAR正确包含所需类的技巧?我不想使用蚂蚁或Maven.
我正在尝试运行我的项目,但我不断收到此错误:
错误:任务':app:preDexDebug'的执行失败.com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java''完成非零退出值3
这是我的傻瓜:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.blume.android"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(path: ':endpoints-backend', configuration: 'android-endpoints')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile project(path: ':cloud-backend', configuration: 'android-endpoints')
compile 'javax.persistence:persistence-api:1.0'
compile project(':endpoints-backend')
}
Run Code Online (Sandbox Code Playgroud)
所有帮助表示赞赏.
我将jar文件添加到项目后似乎无法修复此错误:
任务':app:dexDebug'的执行失败.com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java''完成非零退出值1
该程序在没有jar文件的情况下运行,但是当我添加它时,所有内容都会构建但是当我尝试运行它时它会给我这个错误.我搜索并尝试了以下解决方案,但没有修复错误.
为什么java.exe在android studio中以值1退出
错误:任务':app:dexDebug'的执行失败.> comcommand以非零退出值2结束
由于这些解决方案都不起作用,我认为这是一个超过65k的方法问题所以我编辑了我的build.gradle,但问题仍然存在.
https://developer.android.com/tools/building/multidex.html
这是我的app项目的build.grade:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
................
minSdkVersion 15
targetSdkVersion 21
multiDexEnabled = true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:multidex:1.0.0'
compile files('libs/xyz.jar')
}
Run Code Online (Sandbox Code Playgroud)
我不知道如何解决这个问题.任何帮助,将不胜感激.