我正在开发一个启用Multidex的应用程序,以避免65k的限制.我想在Jar类型中添加一个外部库(即iPay Jar SDK).我已经同步了Gradle并取得了成功,但我没能运行该项目.
错误消息如下所示
Error:Execution failed for task ':app:shrinkDebugMultiDexComponents'.
java.io.IOException: Can't read [/[dir]/app/build/intermediates/multi-dex/debug/allclasses.jar] (Can't process class [com/ipay/IpayAcitivity.class] (Unknown verification type [14] in stack map frame))
这是我的Gradle Code
apply plugin: 'com.android.application' apply plugin: 'android-apt' def AAVersion = '3.2' buildscript { repositories { mavenCentral() } dependencies { classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' } } repositories { mavenCentral() mavenLocal() } apt { arguments { androidManifestFile variant.outputs[0].processResources.manifestFile resourcePackageName '[My Package]' } } dependencies { apt "org.androidannotations:androidannotations:$AAVersion" compile "org.androidannotations:androidannotations-api:$AAVersion" compile fileTree(dir: 'libs', include: ['*.jar']) //Libs folder contains: org.apache.http.legacy.jar //and ipay88_androidv7.jar compile 'com.loopj.android:android-async-http:1.4.5' compile 'com.github.rey5137:material:1.2.1' compile 'com.jpardogo.materialtabstrip:library:1.0.9' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:recyclerview-v7:23.0.1' compile 'com.google.android.gms:play-services:8.1.0' compile 'com.facebook.android:facebook-android-sdk:4.7.0' compile 'com.android.support:multidex:1.0.1' compile 'com.github.chrisbanes.actionbarpulltorefresh:library:+' } android { compileSdkVersion 23 buildToolsVersion "23.0.1" useLibrary 'org.apache.http.legacy' defaultConfig { applicationId "[My Application Id]" minSdkVersion 16 targetSdkVersion 23 versionCode 1 versionName "1.0" multiDexEnabled = true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } sourceSets { main { manifest.srcFile 'src/main/AndroidManifest.xml' java.srcDirs = ['src/main/java', 'build/source/apt/debug'] resources.srcDirs = ['src/main/res'] res.srcDirs = ['src/main/res'] assets.srcDirs = ['src/main/assets'] } beta { resources.srcDirs = ['app/src/beta/res'] res.srcDirs = ['app/src/beta/res'] } } signingConfigs { release { ... } } }
在我添加这种类型的外部库(即iPay Jar SDK)之前,应用程序已成功运行.但是在我添加iPay Jar SDK(第二个Jar库)之后出现了问题.
有关详细信息,我已经在https://developer.android.com/tools/building/multidex.html上遵循了本指南, 但它无法正常运行我的项目.
您有什么建议来修复此错误?