严重异常:main java.lang.NoClassDefFoundError:rx.plugins.RxJavaHooks [英] FATAL EXCEPTION: main java.lang.NoClassDefFoundError: rx.plugins.RxJavaHooks
问题描述
成功登录后,在我的应用程序中,通过改造库加载数据.从过去的两天开始,我在我的应用程序中发现了一个重大问题.低于android API级别21应用程序崩溃我在控制台和日志中检查了崩溃.由于未找到类定义错误,因此出现致命异常".高于android API级别23的同一个应用程序.
In my application after successfully login, loading data through retrofit library. from last two days i founded one major issue in my application. below android API level 21 application getting crashes i checked in console and logs. i got "FATAL EXCEPTION" due to no class def found error. same app working above android API level 23.
在 build.gradle
文件
in build.gradle
file
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.rsukumar.gluser"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
//dagger 2
compile 'com.google.dagger:dagger:2.0.2'
provided 'com.google.dagger:dagger-compiler:2.0'
provided 'javax.annotation:jsr250-api:1.0'
compile 'com.neenbedankt.gradle.plugins:android-apt:1.8'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1@aar'
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
//retrofit 2
compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta2'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
}
我的主要问题是为什么我会遇到异常和错误?在不同的Android API级别中也是如此.
My main question is why i'm getting above exception and error? that too in different Android API levels.
推荐答案
此问题可能与对您的应用程序的multidex支持有关.Android版本<21默认情况下不支持Multidex.您需要增强您的应用程序.我按照以下说明为我的应用程序API级别<21
this problem can be related to multidex support for your application. Android Version < 21 do not support Multidex by default. You need to enhance your application. I followed the following instructions to resovle this problem for my applications API Level < 21
这篇关于严重异常:main java.lang.NoClassDefFoundError:rx.plugins.RxJavaHooks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!