0

I am working on an Android Application , Here I am working on chat functionality using QuickBlox Chat. I have done with text , image chat till now . Now I am using Stickers here .

Application is working fine on Lollipop based Android phones ,when I install it on KitKat based Android phones then it gives me following error in Logcat .

Here is the LogCat details :

    FATAL EXCEPTION: main
Process: com.musomeet, PID: 21520
java.lang.NoClassDefFoundError: vc908.stickerfactory.provider.b
at vc908.stickerfactory.provider.a.<init>(Unknown Source)
at vc908.stickerfactory.provider.a.d(Unknown Source)
at vc908.stickerfactory.provider.a.b(Unknown Source)
at vc908.stickerfactory.provider.a.a(Unknown Source)
at vc908.stickerfactory.provider.StickersProvider.a(Unknown Source)
at vc908.stickerfactory.provider.base.BaseContentProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1638)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1609)
at android.app.ActivityThread.installProvider(ActivityThread.java:5008)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4582)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method)

Build.gradle :

    apply plugin: 'com.android.application'

repositories {
    mavenCentral()
    maven { url 'http://maven.stickerpipe.com/artifactory/stickerfactory' }
}

android {
    compileSdkVersion 23
    buildToolsVersion '22.0.1'

    defaultConfig {
        multiDexEnabled = false
        applicationId "com.xxx"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            applicationVariants.all { variant ->
                variant.outputs.each { output ->
                    def newName = output.outputFile.name
                    newName = newName.replace("app-release", "XXXX") 

                    output.outputFile = new File(output.outputFile.parent, newName)
                }
            }
        }
        debug {

            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            applicationVariants.all { variant ->
                variant.outputs.each { output ->
                    def newName = output.outputFile.name
                    newName = newName.replace("app-debug", "XXXX") 
                    output.outputFile = new File(output.outputFile.parent, newName)
                }
            }

        }
    }
}

repositories {
    maven {url "https://jitpack.io"}
}

dependencies {
    compile 'de.hdodenhof:circleimageview:1.2.1'
    compile 'com.android.support:recyclerview-v7:23.0.1'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
    compile 'me.drakeet.materialdialog:library:1.1.0'
    compile 'com.google.android.gms:play-services-gcm:7.5.0'
    compile 'com.google.apis:google-api-services-youtube:v3-rev152-1.20.0'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'com.squareup.retrofit:retrofit:1.8.0'
    compile 'com.wdullaer:materialdatetimepicker:2.1.0'
    compile('com.github.ozodrukh:CircularReveal:1.1.1@aar') { transitive = true; }
    compile files('libs/quickblox-android-sdk-chat-2.4.jar')
    compile files('libs/quickblox-android-sdk-content-2.4.jar')
    compile('vc908.stickers:stickerfactory:0.2.2@aar') {
        transitive = true;
    }
    compile files('libs/quickblox-android-sdk-messages-2.4.jar')
    compile files('libs/quickblox-android-sdk-core-2.4.jar')
    compile 'com.navercorp.pulltorefresh:library:3.2.3@aar'

    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'
    compile files('libs/androidsvg-1.2.2-beta-1.jar')
    compile files('libs/YouTubeAndroidPlayerApi.jar')
}

I have visited the official website of the Sticker library and Quickblox .I have visited many stackoverflow posts ,but no luck .

I don't know the exact fix of this issue .

Help me please .

Shishupal Shakya
  • 1,632
  • 2
  • 18
  • 41

2 Answers2

0

Check into your manifest file if you are using the fallowing provider:

<provider
        android:name="vc908.stickerfactory.provider.StickersProvider"
        android:authorities="com.package_name.stickersProvider"
        android:exported="false"/>

Notice that android:authoritiesin the category tag must be replaced by your application's package name.

0

Please do this steps to enabled MultiDex.

public class YouApplication extends Application {

@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
  }
}

and modify your build.gradle like so:

android {
compileSdkVersion 22
buildToolsVersion "23.0.0"

     defaultConfig {
         minSdkVersion 14 //lower than 14 doesn't support multidex
         targetSdkVersion 22

         // Enabling multidex support.
         multiDexEnabled true
     }
}

dependencies {
    compile 'com.android.support:multidex:1.0.1'
}

I was work 2 days for this error. It is solved using multidex library.

It works for me.

jinkal
  • 1,622
  • 16
  • 21