Could not find method excpetion / NoClassDefFoundError (for external library) BUT not on all devices

若如初见. 提交于 2019-12-12 04:23:48

问题


I'm getting an exception like following:

07-26 10:17:25.991 I/dalvikvm(20751): Could not find method org.slf4j.LoggerFactory.getILoggerFactory, referenced from method com.app.androknife2.utils.L.init
07-26 10:17:25.991 W/dalvikvm(20751): VFY: unable to resolve static method 63525: Lorg/slf4j/LoggerFactory;.getILoggerFactory ()Lorg/slf4j/ILoggerFactory;
07-26 10:17:26.011 E/AndroidRuntime(20751): FATAL EXCEPTION: main
07-26 10:17:26.011 E/AndroidRuntime(20751): Process: com.app.gallery.premium, PID: 20751
07-26 10:17:26.011 E/AndroidRuntime(20751): java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory
07-26 10:17:26.011 E/AndroidRuntime(20751):     at com.app.androknife2.utils.L.d(L.java:165)
07-26 10:17:26.011 E/AndroidRuntime(20751):     at com.app.androknife2.baseClasses.BaseApp$1.d(BaseApp.java:51)
...

The weird thing is, this app is in the play store as a beta app and is working for everyone, but one tester get's this exception, as soon as he start the app (the first log try fails with the above exception).

Any idea, what could be the root cause? The slf4j library is packed into my code, so if I made something wrong proguarding it, it would fail on all devices as far as I understand that...

Any ideas, hints or similar?


回答1:


It looks like you have reached the 65k method limit.

try adding this line:

android:name="android.support.multidex.MultiDexApplication"

on AndroidManifest inside application tag

Note that you can avoid this programatically also: Refer to Apps with Over 64K Methods for more details



来源:https://stackoverflow.com/questions/38605691/could-not-find-method-excpetion-noclassdeffounderror-for-external-library-bu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!