greenfrvr / hashtag-view

Android fully customizable widget for representing data like hashtags collection and similiar.
MIT License
336 stars 54 forks source link

java.lang.NoClassDefFoundError thrown. #2

Closed lawloretienne closed 9 years ago

lawloretienne commented 9 years ago

I tried using your library with this dependency

compile 'com.github.greenfrvr:hashtag-view:1.1.0@aar'

But the app crashes when i call

htv.setData(strings, Transformers.HASH);

with this stacktrace below. It looks like some classes don't get recognized. Specifically the ArrayListMultimap class. Is that not included in your library?

09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/collect/ArrayListMultimap;
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at com.greenfrvr.hashtagview.HashtagView.sort(HashtagView.java:406)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at com.greenfrvr.hashtagview.HashtagView.access$100(HashtagView.java:41)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at com.greenfrvr.hashtagview.HashtagView$1.onPreDraw(HashtagView.java:134)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2055)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.Choreographer.doCallbacks(Choreographer.java:670)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.Choreographer.doFrame(Choreographer.java:606)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:739)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:  Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.common.collect.ArrayListMultimap" on path: DexPathList[[zip file "/data/app/com.etiennelawlor.loop-1/base.apk"],nativeLibraryDirectories=[/data/app/com.etiennelawlor.loop-1/lib/arm, /data/app/com.etiennelawlor.loop-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at com.greenfrvr.hashtagview.HashtagView.sort(HashtagView.java:406) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at com.greenfrvr.hashtagview.HashtagView.access$100(HashtagView.java:41) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at com.greenfrvr.hashtagview.HashtagView$1.onPreDraw(HashtagView.java:134) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2055) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.Choreographer.doCallbacks(Choreographer.java:670) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.Choreographer.doFrame(Choreographer.java:606) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:739) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:   Suppressed: java.lang.ClassNotFoundException: com.google.common.collect.ArrayListMultimap
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at java.lang.Class.classForName(Native Method)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:     at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:           ... 19 more
09-24 16:03:33.344 7542-7542/com.etiennelawlor.loop E/AndroidRuntime:  Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
lawloretienne commented 9 years ago

I changed the dependency to

compile 'com.github.greenfrvr:hashtag-view:1.0.0'

and now it works and won't crash. You should update your README.

lawloretienne commented 9 years ago

Looks like only 1.0.0 is available

http://gradleplease.appspot.com/#hashtag-view