Error message is like:

11-13 13:35:43.810: E/AndroidRuntime(30193): Caused by: android.view.InflateException: Binary XML file line #21: Error inflating class com.wostore.adsdk.ADSdkView

ADSdkView是个嵌在XML文件中的custom view。

11-13 13:35:43.810: E/AndroidRuntime(30193): Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet]

说它的init(context,attributeset)文件找不到。

http://stackoverflow.com/questions/10079585/application-works-in-debug-run-from-eclipse-but-apk-gives-classnotfoundexce  给出了解答,在于这两段描述

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclasseswithmembernames改为-keepclasseswithmembers

Advertisements