【发布时间】:2017-07-01 09:15:40
【问题描述】:
Gradle 同步在运行时未显示任何错误,但当我尝试运行应用程序时却显示错误。
我尝试删除重复的库并在我的MainActivity 中添加了MultiDex.install(this);,并尝试清理和运行该项目,但没有成功。
错误:
错误:任务 ':app:transformClassesWithJarMergingForDebug' 执行失败。 com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com/fathzer/soft/javaluator/demo/DemoApplet.class
我的毕业代码:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.kanwal.calculator_test"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true }
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-
rules.pro'} } }
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:multidex:1.0.1'
androidTestCompile('com.android.support.test.espresso:espresso
core:2.2.2',{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile files('libs/javaluator-3.0.1.jar')}
【问题讨论】:
-
请将您的代码包含为 文本 而不是图像。无法搜索图像,对某些用户而言难以阅读,并且外部图像可能会消失。
-
好的,我在这里发布我的 gradle 代码:
-
dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:multidex:1.0.1' androidTestCompile('com.android. support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support annotations'}) compile 'com.android.support:appcompat-v7:26.+ ' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' 编译文件('libs/javaluator-3.0.1.jar')}
-
请编辑您的问题,而不是发布在 cmets 中,这样会更容易找到和阅读!
-
我刚刚更新了我的问题。
标签: java android xml android-studio