Android 使用多索引列表为ebug转换类

Android 使用多索引列表为ebug转换类,android,android-studio,Android,Android Studio,我的项目运行得很好 在我添加google analytics后,它不允许在.dex文件中使用64k,我已经设置了: defaultConfig { multiDexEnabled true } 但它有以下错误 :main条目:transformClassesWithMultidexlistForDebug失败 错误:任务执行失败:MainEntry:transformClassesWithMultidexlistForDebug'。 java.io.IOException:无法读取[C:

我的项目运行得很好

在我添加google analytics后,它不允许在
.dex
文件中使用64k,我已经设置了:

defaultConfig {
   multiDexEnabled true
}
但它有以下错误

:main条目:transformClassesWithMultidexlistForDebug失败 错误:任务执行失败:MainEntry:transformClassesWithMultidexlistForDebug'。 java.io.IOException:无法读取[C:\Users\temp2\android git\MainEntry\build\intermediates\transforms\Jarming\debug\jars\1\1f\combined.jar](无法处理类[com/vtcpay/a/a.class](堆栈映射框中未知的验证类型[143])

  • 确保已启用多索引输出,如以下代码段所示:

       android {
    compileSdkVersion 21
    buildToolsVersion "21.1.0"
    
    defaultConfig {
        ...
        minSdkVersion 14
        targetSdkVersion 21
        ...
    
        // Enabling multidex support.
        multiDexEnabled true
    }
         ...
    }
    
    dependencies {
         compile 'com.android.support:multidex:1.0.0'
    }
    
  • 确保在清单中添加了从multidex支持库到application元素的multidex应用程序类

  • 
    

  • 确保已启用多索引输出,如以下代码段所示:

       android {
    compileSdkVersion 21
    buildToolsVersion "21.1.0"
    
    defaultConfig {
        ...
        minSdkVersion 14
        targetSdkVersion 21
        ...
    
        // Enabling multidex support.
        multiDexEnabled true
    }
         ...
    }
    
    dependencies {
         compile 'com.android.support:multidex:1.0.0'
    }
    
  • 确保在清单中添加了从multidex支持库到application元素的multidex应用程序类

  • 
    谢谢大家
    我已经找到了解决这个问题的办法。我应该在默认配置下添加这个脚本

    多索引配置需要显著增加生成处理时间,因为生成系统必须对主索引文件中必须包含哪些类以及辅助索引文件中可以包含哪些类做出复杂的决策。这意味着,作为multidex开发过程的一部分执行的例行构建通常需要更长的时间,并且可能会减慢您的开发过程

    productFlavors {
            // Define separate dev and prod product flavors.
            dev {
                // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
                // to pre-dex each module and produce an APK that can be tested on
                // Android Lollipop without time consuming dex merging processes.
                minSdkVersion 21
            }
            prod {
                // The actual minSdkVersion for the application.
                minSdkVersion 14
            }
        }
    
    谢谢大家 我已经找到了解决这个问题的办法。我应该在默认配置下添加这个脚本

    多索引配置需要显著增加生成处理时间,因为生成系统必须对主索引文件中必须包含哪些类以及辅助索引文件中可以包含哪些类做出复杂的决策。这意味着,作为multidex开发过程的一部分执行的例行构建通常需要更长的时间,并且可能会减慢您的开发过程

    productFlavors {
            // Define separate dev and prod product flavors.
            dev {
                // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
                // to pre-dex each module and produce an APK that can be tested on
                // Android Lollipop without time consuming dex merging processes.
                minSdkVersion 21
            }
            prod {
                // The actual minSdkVersion for the application.
                minSdkVersion 14
            }
        }
    

    是否添加了multiDex支持库?我尝试添加com.android.support:multiDex:1.0.0。但是同样的问题你的JDK版本是什么?试着使用JDK-8u101i回答我的帮助你添加了multiDex支持库吗?我试着添加com.android.support:multiDex:1.0.0。但同样的问题你的JDK版本是什么?试着使用JDK-8u101i回答我的帮助你我已经设置了名称。如果我更改为android:name=“android.support.multidex.MultiDexApplication”>构建将无法通过,因为我需要为main应用程序设置android:name。我已经将name设置为。如果我更改为android:name=“android.support.multidex.MultiDexApplication”>构建将无法通过,因为我需要为main应用程序设置android:name。