DexArchiveBuilderException with mXparser.jar on Android Stud



我目前正在使用Android Studio 3.2.1,遇到了一个我无法弄清楚的问题。我从 mathparser.org 下载了一个mxparser.jar文件,以帮助我正确输出方程。

单击链接,下载第一个选项。我提取了MathParser.org-mXparser-v.4.2.0/bin-only/jdk 1.10/MathParser.org-mXparser-v.4.2.0-jdk.1.10.jar文件,将其重命名为mxparser.jar并复制到项目中的applibs文件夹中。

这是一个全新的项目,所以其他一切都是原样。这是我app文件中的代码:

apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.imad.equationtyper"
minSdkVersion 23
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation files('libs/mxparser.jar')
}

该项目构建得很好,但是当我尝试执行它时崩溃并产生此错误:

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process (path to file)applibsmxparser.jar

有谁知道我该如何解决这个问题?

我找到了解决方案!所以我下载的.zip文件夹 mathparser.org 有一大堆.jar文件。我对.jar文件未使用相同的JDK版本编译的怀疑是正确的。也就是说,我使用了较旧的.jar文件之一,它运行良好。感谢您尝试提供帮助!

最新更新