我正在使用Android-Iconfy库https://github.com/JoanZapata/android-iconify
当ı启用缩小时,应用程序在启动时崩溃。
logcat的:
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.IconTextView" on path: DexPathList[[zip file "/data/app/com.mobojobo.vivideodownloader-2/base.apk"],nativeLibraryDirectories=[/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 android.view.LayoutInflater.createView(LayoutInflater.java:571)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:665)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:65)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
构建gradle:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
proguard规则:
-keepattributes *Annotation*
-keepclassmembers class ** {
@com.squareup.otto.Subscribe public *;
@com.squareup.otto.Produce public *;
}
-keep public class org.jsoup.** {
public *;
}
-keep class com.loopj.android.** { *; }
-keep interface com.loopj.android.** { *; }
-keep class com.joanzapata.** { *; }
-keep class android.view.** { *; }
答案 0 :(得分:1)
使用Iconify 2+时,正确的语法是:
<com.joanzapata.iconify.widget.IconTextView
...