当前位置: 首页 > 知识库问答 >
问题:

任务“:app:TransformClassesWithMultiDexListForDebug”执行失败

宋飞文
2023-03-14
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "24.0.0 rc3"

defaultConfig {
    applicationId "com.example.sagar.shavanma"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true

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


dependencies {

compile fileTree(dir: 'libs', include: '*.jar')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.github.nirhart:parallaxscroll:1.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.mcxiaoke.volley:library:1.0.19'
}

共有1个答案

易书
2023-03-14

尝试将其添加到build.gradle文件中:在dependency下

compile 'com.android.support:multidex:1.0.0'

然后为您的应用程序创建一个全局应用程序类:

import android.support.multidex.MultiDex;
public class Global_class extends Application {

 protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
   }
}

在应用程序标记下的清单文件中添加此类

 <application
    android:name="com.package_name.Global_class"
 </application>
 类似资料: