用于调试Instagram JSON解析器的带Multidexlist的java Android转换类
我正在尝试编译和部署我的Android应用程序,但我遇到了一个MultiDex
问题:
Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> java.lang.UnsupportedOperationException (no error message)
我已经尝试了很多修复方法,但都不起作用
我已经尝试过的:
1multiDexEnabled true
2dexOptions
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
}
3在Android Studio设置中关闭即时运行
4重新启动Android Studio和计算机
5清除和重建项目
6文件>使缓存无效/重新启动
7编译'com。安卓支持:多索引:1.0.1'[编辑]
终于重新开始了我的生活,但什么都不想起作用
如何解决此问题
这是我的Gradle文件
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.安卓.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-安卓'
安卓 {
compileSdkVersion 23
buildToolsVersion '24.0.1'
defaultConfig {
applicationId "com.X.Y"
minSdkVersion 15
targetSdkVersion 21
versionCode 90
versionName "1.2.3"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-安卓.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://dl.bintray.com/X/maven/' }
maven { url "https://jitpack.io" }
flatDir {
dirs 'libs'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.安卓.support:appcompat-v7:23.0.1'
// Utils
//ANR Helper & Memory Leaks helper
//compile 'com.github.anrwatchdog:anrwatchdog:1.1.+'
//compile 'com.squareup.leakcanary:leakcanary-安卓:1.4-beta2'
// HoneyWell sdk
compile files('libs/honeywell.jar')
// RealmAdapter
compile 'io.realm:安卓-adapters:1.2.1'
// Volley
compile 'com.mcxiaoke.volley:library:1.0.19'
// EventBus
// compile 'org.greenrobot:eventbus:3.0.0'
// Gson
compile 'com.google.code.gson:gson:2.3.1'
// Jjp
compile 'com.instagram:ig-json-parser-processor:0.0.6+'
// Sticky List headers
compile 'se.emilsjolander:stickylistheaders:2.7.0'
// Parallax
compile 'com.github.nirhart:parallaxscroll:1.0'
// Facebook
compile 'com.facebook.安卓:facebook-安卓-sdk:4.6.0'
// Zbar
compile 'me.dm7.barcodescanner:zbar:1.9'
// NumberProgressBar
compile 'com.daimajia.numberprogressbar:library:1.2@aar'
// AutoFitTextView
compile 'me.grantland:autofittextview:0.2.+'
// RoundedImageView
compile 'com.makeramen:roundedimageview:2.2.0'
// UpdateChecker
compile 'com.github.rampo.updatechecker:library:2.1.8'
// UniversalImageLoader
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
// GifDrawable
compile 'pl.droidsonroids.gif:安卓-gif-drawable:1.1.+'
// PieChart
compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
compile 'com.安卓.support:support-v13:+'
compile('com.crashlytics.sdk.安卓:crashlytics:2.5.5@aar') {
transitive = true;
}
//AndroidSlidingUpPanel
compile 'com.sothree.slidinguppanel:library:3.3.0'
// YPL
compile 'com.X:X安卓library:1.4.0'
compile project(':kdcreader')
}
这里是Gradle控制台
Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature. WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.5 is ignored for debug as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.5 is ignored for debug as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.5 is ignored for release as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.5 is ignored for release as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE :app:preDebugAndroidTestBuild UP-TO-DATE :app:prepareComAndroidSupportMultidex101Library UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72330Library UP-TO-DATE :app:prepareComAndroidSupportSupportCompat2510Library UP-TO-DATE :app:prepareComAndroidSupportSupportCoreUi2510Library UP-TO-DATE :app:prepareComAndroidSupportSupportCoreUtils2510Library UP-TO-DATE :app:prepareComAndroidSupportSupportFragment2510Library UP-TO-DATE :app:prepareComAndroidSupportSupportMediaCompat2510Library UP-TO-DATE :app:prepareComAndroidSupportSupportV132510Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42510Library UP-TO-DATE :app:prepareComCrashlyticsSdkAndroidAnswers136Library UP-TO-DATE :app:prepareComCrashlyticsSdkAndroidBeta114Library UP-TO-DATE :app:prepareComCrashlyticsSdkAndroidCrashlytics255Library UP-TO-DATE :app:prepareComCrashlyticsSdkAndroidCrashlyticsCore238Library UP-TO-DATE :app:prepareComDaimajiaNumberprogressbarLibrary12Library UP-TO-DATE :app:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE :app:prepareComGetkeepsafeRelinkerRelinker122Library UP-TO-DATE :app:prepareComGithubNirhartParallaxscroll10Library UP-TO-DATE :app:prepareComGithubRampoUpdatecheckerLibrary218Library UP-TO-DATE :app:prepareComMakeramenRoundedimageview220Library UP-TO-DATE :app:prepareComSothreeSlidinguppanelLibrary330Library UP-TO-DATE :app:prepareComXXn安卓library140Library UP-TO-DATE :app:prepareIoFabricSdkAndroidFabric1310Library UP-TO-DATE :app:prepareIoRealmAndroidAdapters121Library UP-TO-DATE :app:prepareIoRealmRealmAndroidLibrary211Library UP-TO-DATE :app:prepareMeDm7BarcodescannerCore19Library UP-TO-DATE :app:prepareMeDm7BarcodescannerZbar19Library UP-TO-DATE :app:prepareMeGrantlandAutofittextview021Library UP-TO-DATE :app:preparePlDroidsonroidsGifAndroidGifDrawable1117Library UP-TO-DATE :app:prepareSeEmilsjolanderStickylistheaders270Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:mergeDebugShaders UP-TO-DATE :app:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:processDebugManifest UP-TO-DATE :app:fabricGenerateResourcesDebug :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources :app:mergeDebugResources :app:processDebugResources :app:generateDebugSources :app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE :app:compileDebugJavaWithJavac UP-TO-DATE :app:compileDebugNdk UP-TO-DATE :app:compileDebugSources UP-TO-DATE :app:transformClassesWithRealmTransformerForDebug UP-TO-DATE :app:transformClassesWithJarMergingForDebug UP-TO-DATE :app:transformClassesWithMultidexlistForDebug FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
java.lang.UnsupportedOperationException (no error message)
尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出
构建失败
总时间:5.277秒
[编辑]和有关崩溃的更多信息:http://pastebin.com/vG79DLuN
谢谢你的帮助
# 1 楼答案
我也有同样的问题。在我的应用程序中,我正在使用guava retrying library,它正在获取google guava library version 21。Guava version 21需要JDK 1.8,但没有提供后移植支持,这在我的案例中导致了这个错误
我可以通过包含guava retrying库来解决这个问题,这样它就可以使用guava库的19.0版本: