Java.lang.NoClassDefFoundError: permission failed: Lio / socket / client / IO $ Options

Here are my app.gradle dependencies

    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile 'io.jsonwebtoken:jjwt:0.7.0'
    //jwt
    /*
                 *menu drawer spporting library
                 **/
    compile 'com.android.support:support-core-utils:25.4.0'
    compile('com.mikepenz:materialdrawer:5.9.4@aar') {
        transitive = true
    }
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.mikepenz:iconics-core:2.5.11@aar'
    compile 'com.mikepenz:fontawesome-typeface:4.6.0.1@aar'
    compile 'com.mikepenz:google-material-typeface:2.2.0.1.original@aar'
    /*
                 * Intro library
                 */
    compile 'com.github.paolorotolo:AppIntro:v4.2.0'
    /*
                 * particle library
                 */
    compile 'com.plattysoft.leonids:LeonidsLib:1.3.2'
    /*
             *Firebase autentication
             */
    compile 'com.firebaseui:firebase-ui-auth:2.0.1'
    // Required only if Facebook login support is required
    compile 'com.facebook.android:facebook-android-sdk:4.22.1'
    compile('com.twitter.sdk.android:twitter-core:3.0.0@aar') { transitive = true }
    //cardview for studymaterial display
    compile 'com.loopeer.library:cardstack:1.0.2'
    //AndroidSwipeableCardStack
    compile(name: 'android-card-stack-0.1.6', ext: 'aar')
    compile 'com.google.android.gms:play-services:11.0.2'
    //this added for solving duplicate entry for firebase
    /*
        *exam view pager
        */
    compile 'com.layer-net:step-indicator:1.1.0'
    /*
         *Exapandable layout
         */
    compile 'net.cachapa.expandablelayout:expandablelayout:2.9.1'
    /*
         *Socketio
         */
    compile('io.socket:socket.io-client:1.0.0') {
        // excluding org.json which is provided by Android
        exclude group: 'org.json', module: 'json'
    }
    //for jwt
    compile 'io.jsonwebtoken:jjwt:0.7.0'
    compile 'com.google.code.gson:gson:2.8.0'
}

      

When I try to include compile 'de.hdodenhof:circleimageview:2.1.0'

, I tried all available circular image files. Same.

Application always fails with

FATAL EXCEPTION: main
    Process: com.sample.chat, PID: 21732
    java.lang.NoClassDefFoundError: Failed resolution of: Lio/socket/client/IO$Options;
        at com.sample.chat.io.SocketIO.connectSIO(SocketIO.java:44)
        at com.sample.chat.io.SocketIO.<init>(SocketIO.java:39)
        at com.sample.chat.examroom.OnlineExamHome.onCreate(OnlineExamHome.java:61)
        at android.app.Activity.performCreate(Activity.java:6033)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
        at android.app.ActivityThread.access$800(ActivityThread.java:151)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5254)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "io.socket.client.IO$Options" 
     on path: DexPathList[[zip file "/data/app/com.sample.chat-1/base.apk", zip file "/data/app/com.sample.chat-1/split_lib_dependencies_apk.apk",
     zip file "/data/app/com.sample.chat-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.sample.chat-1/split_lib_slice_1_apk.apk", 
     zip file "/data/app/com.sample.chat-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.sample.chat-1/split_lib_slice_3_apk.apk", 
     zip file "/data/app/com.sample.chat-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.sample.chat-1/split_lib_slice_5_apk.apk",
     zip file "/data/app/com.sample.chat-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.sample.chat-1/split_lib_slice_7_apk.apk", 
     zip file "/data/app/com.sample.chat-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.sample.chat-1/split_lib_slice_9_apk.apk"],
     nativeLibraryDirectories=[/data/app/com.sample.chat-1/lib/arm, /vendor/lib, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
        at com.sample.chat.io.SocketIO.connectSIO(SocketIO.java:44) 
        at com.sample.chat.io.SocketIO.<init>(SocketIO.java:39) 
        at com.sample.chat.examroom.OnlineExamHome.onCreate(OnlineExamHome.java:61) 
        at android.app.Activity.performCreate(Activity.java:6033) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
        at android.app.ActivityThread.access$800(ActivityThread.java:151) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5254) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697) 
        Suppressed: java.lang.ClassNotFoundException: io.socket.client.IO$Options
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                ... 17 more
     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

      

I do not understand what is going on.

+1


source to share


1 answer


Hi I found a solution to this problem, this might help someone with the same problem

Disable instant launch



File -> Settings -> Build, Execution, Deployment -> Instant Run

+1


source







All Articles