kevalpatel2106/EmoticonGIFKeyboard

NoClassDefFoundError: Failed resolution of: Lcom/kevalpatel2106/emoticongifkeyboard/internal/emoticon/EmoticonDbHelper;

Vitor238 opened this issue · 1 comments

When opening my activity and the keyboard, my app is closing with this following error :

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/kevalpatel2106/emoticongifkeyboard/internal/emoticon/EmoticonDbHelper;
        at com.kevalpatel2106.emoticongifkeyboard.internal.emoticon.EmoticonGridFragment.getEmoticonsList(EmoticonGridFragment.java:153)
        at com.kevalpatel2106.emoticongifkeyboard.internal.emoticon.EmoticonGridFragment.onViewCreated(EmoticonGridFragment.java:96)
        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:322)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1185)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1354)
        at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1432)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1495)
        at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
        at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2167)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1990)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1945)
        at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1816)
        at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:303)
        at androidx.fragment.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:262)
        at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1244)
        at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1092)
        at androidx.viewpager.widget.ViewPager.onMeasure(ViewPager.java:1622)
        at android.view.View.measure(View.java:19834)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6164)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
        at android.view.View.measure(View.java:19834)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6164)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:19834)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6164)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
        at android.view.View.measure(View.java:19834)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6164)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:19834)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6164)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at androidx.cardview.widget.CardView.onMeasure(CardView.java:260)
        at android.view.View.measure(View.java:19834)
        at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
        at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
        at android.view.View.measure(View.java:19834)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6164)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
        at android.view.View.measure(View.java:19834)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6164)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:19834)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6164)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:19834)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6164)
E/AndroidRuntime:     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
        at android.view.View.measure(View.java:19834)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6164)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at com.android.internal.policy.DecorView.onMeasure(DecorView.java:692)
        at android.view.View.measure(View.java:19834)
        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2351)
        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1423)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1672)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1299)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6558)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
        at android.view.Choreographer.doCallbacks(Choreographer.java:683)
        at android.view.Choreographer.doFrame(Choreographer.java:619)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6316)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
     Caused by: java.lang.ClassNotFoundException: com.kevalpatel2106.emoticongifkeyboard.internal.emoticon.EmoticonDbHelper
        at java.lang.VMClassLoader.findLoadedClass(Native Method)
        at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        	... 76 more
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/readystatesoftware/sqliteasset/SQLiteAssetHelper;
        	... 76 more
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.readystatesoftware.sqliteasset.SQLiteAssetHelper" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/myapp.myapp.com.myapp-1/base.apk"],nativeLibraryDirectories=[/data/app/myapp.myapp.com.myapp-1/lib/arm, /data/app/myapp.myapp.com.myapp-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        	... 76 more

My code:

private fun configurarEmojiGifKeyboard() {

     emojiEditTextChat.setEmoticonProvider(IosEmoticonProvider.create())

     val emoticonConfig: EmoticonGIFKeyboardFragment.EmoticonConfig = EmoticonGIFKeyboardFragment.EmoticonConfig()
             .setEmoticonProvider(IosEmoticonProvider.create()) /*
       NOTE: The process of removing last character when user preses back space will handle
       by library if your edit text is in focus.
      */
             .setEmoticonSelectListener(object : EmoticonSelectListener {
                 override fun onBackSpace() {


                 }

                 override fun emoticonSelected(emoticon: Emoticon) {
                     emojiEditTextChat.append(emoticon.unicode,
                     emojiEditTextChat.selectionStart,
                     emojiEditTextChat.selectionEnd)
                 }

             })

     //Create GIF config
     val gifConfig = GIFConfig(GiphyGifProvider.create(this, getString(R.string.giphy_api_key)))
             .setGifSelectListener { gif -> //Do something with the selected GIF.
                 Log.d("Emoji", "onGifSelected: " + gif.gifUrl)
                 toast(gif.gifUrl)
             }

     emoticonGIFKeyboardFragment = EmoticonGIFKeyboardFragment
             .getNewInstance(findViewById(R.id.keyboard_container), emoticonConfig, gifConfig);
     supportFragmentManager
             .beginTransaction()
             .replace(R.id.keyboard_container, emoticonGIFKeyboardFragment)
             .commit();
     emoticonGIFKeyboardFragment.open()

     //Set smiley button to open/close the emoticon gif keyboard
     botaoEmojiChat.setOnClickListener {
         emoticonGIFKeyboardFragment.toggle()
         toggleKeyboardVisibility(this@ChatActivity)
     }
 }

How to solve this problem? Thanks in advance!

#6 (comment).

Please check this out it will resolve your error