youlookwhat / ByRecyclerView

🔥 RecyclerView 下拉刷新、上拉松手/自动加载更多、item点击/长按、item局部刷新、头布局/尾布局/状态布局、万能分割线、Skeleton骨架图、极简adapter、嵌套滑动置顶
https://youlookwhat.github.io/ByRecyclerView
Apache License 2.0
798 stars 139 forks source link

在ByRecyclerView中CoordinatorLayout包报错 #7

Closed cattle1219 closed 4 years ago

cattle1219 commented 4 years ago

Didn't find class "androidx.coordinatorlayout.widget.CoordinatorLayout",我的工程中引入的是Androidx

youlookwhat commented 4 years ago

你引入的是 `implementation 'com.github.youlookwhat:ByRecyclerView:1.0.15'吗,还是直接引入的library呢?

youlookwhat commented 4 years ago

如果你引入的是library,因为其中引入了 'androidx.recyclerview:recyclerview:1.0.0' ,这里面会包含 androidx.coordinatorlayout:coordinatorlayout:1.0.0 ,所以应该会有CoordinatorLayout这个类。

你能描述的尽量再清楚些吗,我也好排查问题。

cattle1219 commented 4 years ago

我是在我的lib里面通过 api 引用了你的byrecycleview,然后通过我的lib在项目中调用了byrecycleview,就报这个错,项目用的是Androidx,不过在lib里面倒是没有引用AndroidX,不知道跟这个是否有关系

------------------ 原始邮件 ------------------ 发件人: "景彬"<notifications@github.com>; 发送时间: 2020年2月9日(星期天) 晚上7:30 收件人: "youlookwhat/ByRecyclerView"<ByRecyclerView@noreply.github.com>; 抄送: "黄楚雄"<274192856@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [youlookwhat/ByRecyclerView] 在ByRecyclerView中CoordinatorLayout包报错 (#7)

如果你引入的是library,因为其中引入了 'androidx.recyclerview:recyclerview:1.0.0' ,这里面会包含 androidx.coordinatorlayout:coordinatorlayout:1.0.0 ,所以应该会有CoordinatorLayout这个类。

你能描述的尽量再清楚些吗,我也好排查问题。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

youlookwhat commented 4 years ago

我这边没看到你的lib配置所以很难找出原因,你能把你的配置发一下吗?并把你报错的地方也发我一下,我更好定位一些。

cattle1219 commented 4 years ago

抱歉,疫情期间一直在忙其他的事,没来得及回复。 app配置: dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'

implementation project(path: ':hcxlib')
implementation 'org.java-websocket:Java-WebSocket:1.4.0'
implementation project(path: ':lianmedchart')

//个推推送集成
implementation 'com.getui:sdk:2.13.3.0'

//腾讯bugly集成
implementation 'com.tencent.bugly:crashreport:3.1.0' 
implementation 'com.tencent.bugly:nativecrashreport:3.3.1' 
//OSS上传
implementation 'com.aliyun.dpa:oss-android-sdk:2.9.3'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

lib配置如下: dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.1.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

api 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:retrofit:2.7.1'
implementation 'com.squareup.retrofit2:converter-gson:2.7.1'
implementation 'com.squareup.okhttp3:okhttp:4.3.1'
implementation 'com.squareup.okhttp3:logging-interceptor:4.3.1'
implementation 'com.squareup.okio:okio:2.4.3'

api "io.reactivex.rxjava2:rxjava:2.2.7"
api 'io.reactivex.rxjava2:rxandroid:2.1.1'
api 'com.squareup.retrofit2:adapter-rxjava2:2.7.1'

api 'androidx.lifecycle:lifecycle-extensions:2.2.0'

// Glide
api 'com.github.bumptech.glide:glide:4.9.0'

//动态权限申请
api 'com.github.tbruyelle:rxpermissions:0.10.2' 
api 'com.github.youlookwhat:ByRecyclerView:1.0.15'

api 'com.github.ybq:Android-SpinKit:1.4.0'

报错如下: 02-17 11:52:41.772 30322-30322/com.lianmed.remotemonitor E/art: ClassLinker::FindClass not found:Landroidx/transition/FragmentTransitionSupport; 02-17 11:52:41.803 30322-30322/com.lianmed.remotemonitor E/art: ClassLinker::FindClass not found:Lcom/bumptech/glide/GeneratedAppGlideModuleImpl; 02-17 11:53:07.054 30322-30322/com.lianmed.remotemonitor E/art: ClassLinker::FindClass not found:Landroidx/coordinatorlayout/widget/CoordinatorLayout; 02-17 11:53:07.055 30322-30322/com.lianmed.remotemonitor E/art: ClassLinker::FindClass not found:Lcom/google/android/material/appbar/AppBarLayout; 02-17 11:53:07.055 30322-30322/com.lianmed.remotemonitor E/art: ClassLinker::FindClass not found:Lcom/google/android/material/appbar/AppBarLayout$OnOffsetChangedListener; 02-17 11:53:07.056 30322-30322/com.lianmed.remotemonitor E/art: ClassLinker::FindClass not found:Lme/jingbin/library/AppBarStateChangeListener; 02-17 11:53:07.056 30322-30322/com.lianmed.remotemonitor E/art: ClassLinker::FindClass not found:Lme/jingbin/library/ByRecyclerView$8; 02-17 11:53:07.109 30322-30322/com.lianmed.remotemonitor E/art: ClassLinker::FindClass not found:Landroidx/coordinatorlayout/widget/CoordinatorLayout; 02-17 11:53:07.279 30322-30322/com.lianmed.remotemonitor E/AndroidRuntime: FATAL EXCEPTION: main     Process: com.lianmed.remotemonitor, PID: 30322     java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/coordinatorlayout/widget/CoordinatorLayout;         at me.jingbin.library.ByRecyclerView.onAttachedToWindow(ByRecyclerView.java:825)         at android.view.View.dispatchAttachedToWindow(View.java:13730)         at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2815)         at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)         at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)         at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)         at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)         at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)         at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)         at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)         at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1551)         at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1292)         at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6598)         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:800)         at android.view.Choreographer.doCallbacks(Choreographer.java:603)         at android.view.Choreographer.doFrame(Choreographer.java:572)         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:786)         at android.os.Handler.handleCallback(Handler.java:815)         at android.os.Handler.dispatchMessage(Handler.java:104)         at android.os.Looper.loop(Looper.java:194)         at android.app.ActivityThread.main(ActivityThread.java:5682)         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:963)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758)      Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.coordinatorlayout.widget.CoordinatorLayout" on path: DexPathList[[zip file "/data/app/com.lianmed.remotemonitor-2/base.apk"],nativeLibraryDirectories=[/data/app/com.lianmed.remotemonitor-2/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 me.jingbin.library.ByRecyclerView.onAttachedToWindow(ByRecyclerView.java:825)          at android.view.View.dispatchAttachedToWindow(View.java:13730)          at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2815)          at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)          at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)          at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)          at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)          at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)          at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)          at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2822)          at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1551)          at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1292)          at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6598)          at android.view.Choreographer$CallbackRecord.run(Choreographer.java:800)          at android.view.Choreographer.doCallbacks(Choreographer.java:603)          at android.view.Choreographer.doFrame(Choreographer.java:572)          at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:786)          at android.os.Handler.handleCallback(Handler.java:815)          at android.os.Handler.dispatchMessage(Handler.java:104)          at android.os.Looper.loop(Looper.java:194)          at android.app.ActivityThread.main(ActivityThread.java:5682)          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:963)          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758)       Suppressed: java.lang.ClassNotFoundException: androidx.coordinatorlayout.widget.CoordinatorLayout         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)           ... 26 more      Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

------------------ 原始邮件 ------------------ 发件人: "景彬"<notifications@github.com>; 发送时间: 2020年2月9日(星期天) 晚上8:28 收件人: "youlookwhat/ByRecyclerView"<ByRecyclerView@noreply.github.com>; 抄送: "黄楚雄"<274192856@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [youlookwhat/ByRecyclerView] 在ByRecyclerView中CoordinatorLayout包报错 (#7)

我这边没看到你的lib配置所以很难找出原因,你能把你的配置发一下吗?并把你报错的地方也发我一下,我更好定位一些。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

cattle1219 commented 4 years ago

找到原因了: 我的lib没有导入 appbarlayout和coordinatorlayout这两个库。 谢谢你的回复

------------------ 原始邮件 ------------------ 发件人: "景彬"<notifications@github.com>; 发送时间: 2020年2月9日(星期天) 晚上8:28 收件人: "youlookwhat/ByRecyclerView"<ByRecyclerView@noreply.github.com>; 抄送: "黄楚雄"<274192856@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [youlookwhat/ByRecyclerView] 在ByRecyclerView中CoordinatorLayout包报错 (#7)

我这边没看到你的lib配置所以很难找出原因,你能把你的配置发一下吗?并把你报错的地方也发我一下,我更好定位一些。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

youlookwhat commented 4 years ago

恩恩 找到了原因就好😄

youlookwhat commented 4 years ago

我先关掉这个问题了,有其他问题再提吧~