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.NoClassDefFoundError,自己解决了,贡献一下思路。 #32

Closed
5 tasks done
crook3 opened this issue Aug 30, 2018 · 11 comments
Closed
5 tasks done

Comments

@crook3
Copy link

crook3 commented Aug 30, 2018

Environment

  • Autosize Version: v0.9.1
  • Target Android Version: Android 6.0.1
  • Device Model: 网易mumu模拟器
  • Device Resolution: 1080px * 1920px
  • Design Size On AndroidManifest: 1280dp * 720dp

Bug Description:

java.lang.NoClassDefFoundError: me.jessyan.autosize.FragmentLifecycleCallbacksImpl
at me.jessyan.autosize.ActivityLifecycleCallbacksImpl.(ActivityLifecycleCallbacksImpl.java:45)

日志中提示FragmentLifecycleCallbacksImpl这个类找不到,报错,但是我去External Libraries里面能找到引入的Autosize包里面有该类。所以这个问题显得很诡异。
不知道问题出在哪里,只能回到原点,自己新建工程,重新引入,运行,没问题!这就奇怪了。于是我对比gradle里面的依赖及配置信息,由于使用的是Android studio 3.1.4,compileSdkVersion,targetSdkVersion,com.android.support:appcompat-v7:26.1.0等属性版本不一致,版本23可能太低了, 改成使用新建工程后的默认版本26,具体版本可参照新建工程后的版本,问题解决了。

Log:


Screenshot

Related Code:

  

Others:

@JessYanCoding
Copy link
Owner

ok,感谢贡献,已将该 issues 收录于 #13 (comment)

@GeminiWy
Copy link

GeminiWy commented Nov 8, 2018

请问在不升级版本的情况下,这个问题有没有其他方案解决呢?FragmentManager.FragmentLifecycleCallbacks可以替换成其他的类吗?

@JessYanCoding
Copy link
Owner

@GeminiWy 使用旧版本 v0.7.0,里面不包含 FragmentManager.FragmentLifecycleCallback 以及 v7 包

@GeminiWy
Copy link

GeminiWy commented Nov 8, 2018

@JessYanCoding 谢谢

@AndBird
Copy link

AndBird commented Jan 3, 2019

这个坑我也找了好久,需要support v4 25以上
implementation 'me.jessyan:autosize:1.1.1'
implementation 'com.android.support:support-v4:25.3.0'

@yuxuelian
Copy link

yuxuelian commented May 20, 2019

我也遇到了这个错误 这里分享一下我的解决经验
我报这个错误是因为我使用了AndroidX 这个工程还是使用的v4那套兼容包 在 gradle.properties 添加
android.useAndroidX=true
android.enableJetifier=true
这两个配置,重新编译 问题解决

@kongfanshuai
Copy link

kongfanshuai commented May 20, 2019

java.lang.RuntimeException: Unable to get provider me.jessyan.autosize.InitProvider: java.lang.ClassNotFoundException: Didn't find class "me.jessyan.autosize.InitProvider"
在android 4.4系统上报这个错,oppop手机

@JessYanCoding JessYanCoding mentioned this issue Aug 9, 2019
5 tasks
@JessYanCoding
Copy link
Owner

@kongfanshuai multidex

@qrh672114236
Copy link

java.lang.ClassNotFoundException,Didn't find class "me.jessyan.autosize.InitProvider" on path: DexPathList[[zip file "/data/app/-1.apk"],nativeLibraryDirectories=[/data/app-lib-1, /vendor/lib, /system/lib, /data/datalib]],BaseDexClassLoader.java,56]

兼容测试部分手机运行报这个错误 ,App 已添加 MultiDex.install(this) auto版本1.1.2 multidex版本1.0.3

@e9ab98e991ab
Copy link

AndroidAutoSize 0.7.0 + 1.1.2 综合版本
https://github.com/e9ab98e991ab/AndroidAutoSize

@Allen-ZXJ
Copy link

java.lang.ClassNotFoundException,Didn't find class "me.jessyan.autosize.InitProvider" on path: DexPathList[[zip file "/data/app/-1.apk"],nativeLibraryDirectories=[/data/app-lib-1, /vendor/lib, /system/lib, /data/datalib]],BaseDexClassLoader.java,56]

auto版本1.2.1, 系统android10,奔溃

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

9 participants