Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
460 views
in Technique[技术] by (71.8m points)

java - Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug' android studio

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

someone can help me please.

The error

Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. java.io.IOException: Can't write [C:UsersyouneDesktopandroid2appuildintermediatesmulti-dexdebugcomponentClasses.jar] (Can't read [C:Usersyoune.gradlecachesransforms-1files-1.1support-core-ui-25.2.0.aar9adfc8649fc899fbc5e371e8bc1c399ajarsclasses.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:android/support/v4/view/ViewPager$2.class]))

I am using

Android Studio 3.0

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

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

And i have Multidex enabled

In my app build.gradle file:

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')
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
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'

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...