Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.RuntimeException: Unable to find Class for com.mybataz.contest.h$SwipeViewBinder #114

Closed
Yellu opened this issue Apr 21, 2018 · 8 comments

Comments

@Yellu
Copy link

Yellu commented Apr 21, 2018

04-21 12:06:20.460 1418-1418/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: bataz.com.bataz, PID: 1418
java.lang.RuntimeException: Unable to start activity ComponentInfo{bataz.com.bataz/com.mybataz.contest.RateNowActivity}: java.lang.RuntimeException: Unable to find Class for com.mybataz.contest.h$SwipeViewBinder
PLEASE ADD >> annotationProcessor 'com.mindorks.android:placeholderview-compiler:' << in build.gradle
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2785)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1532)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6342)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
Caused by: java.lang.RuntimeException: Unable to find Class for com.mybataz.contest.h$SwipeViewBinder
PLEASE ADD >> annotationProcessor 'com.mindorks.android:placeholderview-compiler:' << in build.gradle
at com.mindorks.placeholderview.c.a(Unknown Source)
at com.mindorks.placeholderview.c.a(Unknown Source)
at com.mindorks.placeholderview.SwipePlaceHolderView.a(Unknown Source)
at com.mindorks.placeholderview.SwipePlaceHolderView.b(Unknown Source)
at com.mybataz.contest.RateNowActivity.onPostCreate(Unknown Source)
at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1200)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2706)
... 9 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mybataz.contest.h$SwipeViewBinder" on path: DexPathList[[zip file "/data/app/bataz.com.bataz-1/base.apk"],nativeLibraryDirectories=[/data/app/bataz.com.bataz-1/lib/arm, /data/app/bataz.com.bataz-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)
... 16 more

@Yellu
Copy link
Author

Yellu commented Apr 21, 2018

App crashing, in signed apk build, anyone please help me

@janishar
Copy link
Owner

@Yellu Which library version you are using?

use 1.0.2+ version

 compile 'com.mindorks.android:placeholderview:1.0.2'
annotationProcessor 'com.mindorks.android:placeholderview-compiler:1.0.2'

@Yellu
Copy link
Author

Yellu commented Apr 22, 2018

@janishar, using kotlin supported versions (1.0.2)

compile 'com.mindorks.android:placeholderview:1.0.2'
kapt 'com.mindorks.android:placeholderview-compiler:1.0.2'

in debug build it is working without any problem, but in signed apk with progaurd, it is crashing

@janishar
Copy link
Owner

janishar commented Apr 22, 2018

@Yellu
It is fixed. Upgrade to version 1.0.3

compile 'com.mindorks.android:placeholderview:1.0.3'
kapt 'com.mindorks.android:placeholderview-compiler:1.0.3'

@Yellu
Copy link
Author

Yellu commented Apr 23, 2018

Thank you @janishar

@Yellu Yellu closed this as completed Apr 23, 2018
@mpontus
Copy link

mpontus commented Jul 17, 2018

I keep having this exact problem even after updating to the latest version:

07-17 12:13:27.162 9574-9574/com.mpontus.dictio E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.mpontus.dictio, PID: 9574
    java.lang.RuntimeException: Unable to find Class for com.mpontus.dictio.ui.lesson.k$SwipeViewBinder
    PLEASE ADD >> annotationProcessor 'com.mindorks.android:placeholderview-compiler:<LATEST-VERSION>' << in build.gradle
        at com.mindorks.placeholderview.c.a(Binding.java:44)
        at com.mindorks.placeholderview.c.a(Binding.java:67)
        at com.mindorks.placeholderview.SwipePlaceHolderView.a(SwipePlaceHolderView.java:206)
        at com.mindorks.placeholderview.SwipePlaceHolderView.b(SwipePlaceHolderView.java:214)
        at com.mpontus.dictio.ui.lesson.LessonActivity.a(LessonActivity.java:79)
        at com.mpontus.dictio.ui.lesson.b.a(Unknown Source)
        at android.arch.lifecycle.LiveData.a(LiveData.java:109)
        at android.arch.lifecycle.LiveData.b(LiveData.java:126)
        at android.arch.lifecycle.LiveData.b(LiveData.java:282)
        at android.arch.lifecycle.LiveData$1.run(LiveData.java:87)
        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:6119)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mpontus.dictio.ui.lesson.k$SwipeViewBinder" on path: DexPathList[[zip file "/data/app/com.mpontus.dictio-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mpontus.dictio-1/lib/x86, /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)
        at com.mindorks.placeholderview.c.a(Binding.java:25)
        at com.mindorks.placeholderview.c.a(Binding.java:67) 
        at com.mindorks.placeholderview.SwipePlaceHolderView.a(SwipePlaceHolderView.java:206) 
        at com.mindorks.placeholderview.SwipePlaceHolderView.b(SwipePlaceHolderView.java:214) 
        at com.mpontus.dictio.ui.lesson.LessonActivity.a(LessonActivity.java:79) 
        at com.mpontus.dictio.ui.lesson.b.a(Unknown Source) 
        at android.arch.lifecycle.LiveData.a(LiveData.java:109) 
        at android.arch.lifecycle.LiveData.b(LiveData.java:126) 
        at android.arch.lifecycle.LiveData.b(LiveData.java:282) 
        at android.arch.lifecycle.LiveData$1.run(LiveData.java:87) 
        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:6119) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

I managed to get around it by adding the following line to proguard-rules.pro:

-keep class com.mpontus.dictio.ui.lesson.** { *; }

@desaianand1
Copy link

desaianand1 commented Feb 4, 2019

Also using version 1.0.3 , getting the same error:
E/AndroidRuntime: FATAL EXCEPTION: main Process: edu.rosehulman.whodoyouknowhere.whodoyouknowhere, PID: 17287 java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.rosehulman.whodoyouknowhere.whodoyouknowhere/edu.rosehulman.whodoyouknowhere.whodoyouknowhere.MainActivity}: java.lang.RuntimeException: Unable to find Class for edu.rosehulman.whodoyouknowhere.whodoyouknowhere.EventCard$SwipeViewBinder PLEASE ADD >> annotationProcessor 'com.mindorks.android:placeholderview-compiler:<LATEST-VERSION>' << in build.gradle at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.RuntimeException: Unable to find Class for edu.rosehulman.whodoyouknowhere.whodoyouknowhere.EventCard$SwipeViewBinder PLEASE ADD >> annotationProcessor 'com.mindorks.android:placeholderview-compiler:<LATEST-VERSION>' << in build.gradle at com.mindorks.placeholderview.Binding.getBinderInstance(Binding.java:44) at com.mindorks.placeholderview.Binding.bindSwipeViewResolver(Binding.java:67) at com.mindorks.placeholderview.SwipePlaceHolderView.getViewBinder(SwipePlaceHolderView.java:206) at com.mindorks.placeholderview.SwipePlaceHolderView.addView(SwipePlaceHolderView.java:214) at edu.rosehulman.whodoyouknowhere.whodoyouknowhere.MainActivity.setupSwipeView(MainActivity.kt:223) at edu.rosehulman.whodoyouknowhere.whodoyouknowhere.MainActivity.onCreate(MainActivity.kt:115) at android.app.Activity.performCreate(Activity.java:7136) at android.app.Activity.performCreate(Activity.java:7127) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893) ... 11 more Caused by: java.lang.ClassNotFoundException: Didn't find class "edu.rosehulman.whodoyouknowhere.whodoyouknowhere.EventCard$SwipeViewBinder" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/edu.rosehulman.whodoyouknowhere.whodoyouknowhere-wsmROqG4CUd8Iy4fCyI_EQ==/base.apk"],nativeLibraryDirectories=[/data/app/edu.rosehulman.whodoyouknowhere.whodoyouknowhere-wsmROqG4CUd8Iy4fCyI_EQ==/lib/x86, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.mindorks.placeholderview.Binding.getBinderInstance(Binding.java:25) ... 20 more

My app's build.gradle

`dependencies {
. . .
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.mindorks.android:placeholderview:1.0.3'
kapt'com.mindorks.android:placeholderview-compiler:1.0.3'

}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-kapt'`

I haven't been able to figure out the issue yet. (on latest version, 1.0.3 too and have tried downgrading)

@ChampIsMe
Copy link

ChampIsMe commented Jun 16, 2019

@Yellu
It is fixed. Upgrade to version 1.0.3

compile 'com.mindorks.android:placeholderview:1.0.3'
kapt 'com.mindorks.android:placeholderview-compiler:1.0.3'

This is not working for me yet am using same and exact versions, or does it have issues in androidX? I have same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants