错误:任务 ':app:transformClassesWithMultidexlistForDebug' android studio 执行失败 [英] Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug' android studio

查看:41
本文介绍了错误:任务 ':app:transformClassesWithMultidexlistForDebug' android studio 执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 buildbox 上创建了一个游戏我导出了项目但我无法在 android studio 上启动游戏我的问题是我无法运行应用程序或生成 apk 文件

I create a game on buildbox I export the project but I can't start the game on android studio My problem is that I can't run the application or produce an apk file

请有人可以帮助我.

错误

错误:任务:app:transformClassesWithMultidexlistForDebug"的执行失败.java.io.IOException: 无法写入 [C:\Users\youne\Desktop\android2\app\build\intermediates\multi-dex\debug\componentClasses.jar](无法读取 [C:\Users\youne.gradle\caches\transforms-1\files-1.1\support-core-ui-25.2.0.aar\9adfc8649fc899fbc5e371e8bc1c399a\jars\classes.jar(;;;;;;;**.class)](重复的 zip 条目 [classes.jar:android/support/v4/view/ViewPager$2.class]))

Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. java.io.IOException: Can't write [C:\Users\youne\Desktop\android2\app\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't read [C:\Users\youne.gradle\caches\transforms-1\files-1.1\support-core-ui-25.2.0.aar\9adfc8649fc899fbc5e371e8bc1c399a\jars\classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:android/support/v4/view/ViewPager$2.class]))

我正在使用

Android Studio 3.0

Android Studio 3.0

Java 版本:Java(TM) SE 运行时环境(构建 1.8.0_73-b02).

Java version: Java(TM) SE Runtime Environment (build 1.8.0_73-b02).

Gradle 版本:com.android.tools.build:gradle:4.1

Gradle Version: com.android.tools.build:gradle:4.1

而且我启用了 Multidex

And i have Multidex enabled

在我的应用 build.gradle 文件中:

android {
  compileSdkVersion 27
  buildToolsVersion '27.0.1'

  defaultConfig {
    applicationId "com.drh.bird"
    minSdkVersion 14
    targetSdkVersion 23
    aaptOptions.cruncherEnabled = false
    aaptOptions.useNewCruncher = false
    compileOptions.encoding = 'ISO-8859-1'
    multiDexEnabled = true

    ndk {
      moduleName "player_shared"
    }
  }
  android {
    useLibrary 'org.apache.http.legacy'
  }
  sourceSets {
    main {
      jni.srcDirs = []
    }
  }

  buildTypes {}
  android {
    defaultConfig {
      multiDexEnabled true
    }
  }
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
  }

  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
  }
}

dependencies {
  compile 'com.android.support:multidex:1.0.1'
  compile 'com.google.android.gms:play-services:+'
  compile files('libs/dagger-1.2.2.jar')
  compile files('libs/javax.inject-1.jar')
  compile files('libs/nineoldandroids-2.4.0.jar')
  compile files('libs/support-v4-19.0.1.jar')
}

推荐答案

implementation 'com.android.support:appcompat-v7:27.1.0'
 implementation 'com.android.support:design:27.1.0'
    implementation 'com.android.support:support-v4:27.1.0'
 implementation 'com.android.support:recyclerview-v7:27.1.0'

像上面一样将所有支持库更新到 27.1.0 并删除重复项

update your all support library to 27.1.0 like above and remove duplicates

这篇关于错误:任务 ':app:transformClassesWithMultidexlistForDebug' android studio 执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆