java.lang.ClassNotFoundException in dalvik.system.BaseDexClassLoader.findClass

Deadly 提交于 2019-11-27 22:29:27

So it was indeed ProGuard that was stripping code from my project. I use ActionBarSherlock and facebook and this is what I added so it would work:

# ActionBarSherlock 

-keep class android.support.** { *; } 

-keep interface android.support.** { *; } 

-keep class com.actionbarsherlock.** { *; } 

-keep interface com.actionbarsherlock.** { *; } 




# Keep line numbers to alleviate debugging stack traces 

-renamesourcefileattribute SourceFile 

-keepattributes SourceFile,LineNumberTable

This for facebook:

-keepclassmembers class * implements java.io.Serializable
{
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}
George

Well, I'd suggest you focus at the difference between the build you are doing from eclipse and the build you are providing to the Play Store.

If you can reproduce the error you see from the playstore, while building it with eclipse and testing it, you will surely find the answer.

What I can think of is the certificates that the app gets signed, but it doesn't seem to be it. However you should think more about what is the difference between the two .apk's - the developer build and the build for playstore.

As .apk are basically archives, you can unzip them both, see differences between them. You should use a dedexer to try and decompile the two instances of classes.dex (see decompiling DEX into Java sourcecode ). It will likely be highly obfuscated code, but you should look for missing classes or something like that.

Hope you get it right.

Right click on your project folder => Properties => Java Build Path => Order and Export => check the box "Android Private Libraries" if not checked. And it works !

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