ClassNotFoundException in release build
<p>I'm getting a ClassNotFoundExption of a custom DialogPreference class, but only after making a release build. I works perfectly for debugging builds.</p>

<p>Here is the stack trace:</p>

<pre><code>10-26 16:29:08.521: E/AndroidRuntime(20593): FATAL EXCEPTION: main
10-26 16:29:08.521: E/AndroidRuntime(20593): java.lang.RuntimeException: Unable to start activity ComponentInfo{path.to.my.app.de/path.to.my.app.preferences.Preferences}: android.view.InflateException: Binary XML file line #6: Error inflating class path.to.my.app.preferences.SeekBarPreference
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.app.ActivityThread.access$2300(ActivityThread.java:135)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.os.Handler.dispatchMessage(Handler.java:99)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.os.Looper.loop(Looper.java:144)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.app.ActivityThread.main(ActivityThread.java:4937)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at java.lang.reflect.Method.invokeNative(Native Method)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at java.lang.reflect.Method.invoke(Method.java:521)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at dalvik.system.NativeStart.main(Native Method)
10-26 16:29:08.521: E/AndroidRuntime(20593): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class path.to.my.app.preferences.SeekBarPreference
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:441)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.preference.GenericInflater.rInflate(GenericInflater.java:481)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.preference.GenericInflater.rInflate(GenericInflater.java:493)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.preference.GenericInflater.inflate(GenericInflater.java:326)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.preference.GenericInflater.inflate(GenericInflater.java:263)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:254)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:268)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at path.to.my.app.preferences.Preferences.onCreate(Unknown Source)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)
10-26 16:29:08.521: E/AndroidRuntime(20593):    ... 11 more
10-26 16:29:08.521: E/AndroidRuntime(20593): Caused by: java.lang.ClassNotFoundException: path.to.my.app.preferences.SeekBarPreference in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/path.to.my.app.de-1.apk]
10-26 16:29:08.521: E/AndroidRuntime(20593):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.preference.GenericInflater.createItem(GenericInflater.java:375)
10-26 16:29:08.521: E/AndroidRuntime(20593):    at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:430)
10-26 16:29:08.521: E/AndroidRuntime(20593):    ... 20 more
</code></pre>

<p>The xml-file which is called at the stack trace is:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:key="screen"&gt;
  &lt;PreferenceCategory android:title="@string/pref.title" android:key="cat1" android:order="1"&gt;
    &lt;path.to.my.app.preferences.SeekBarPreference android:title="@string/perimeter.head" android:key="myapp.perimeter" android:defaultValue="30" android:text=" km" android:max="80" min="5" android:progress="0"/&gt;
    &lt;CheckBoxPreference android:key="myapp.saveFav" android:enabled="true" android:title="@string/fav.save.title" android:summary="@string/fav.save"&gt;&lt;/CheckBoxPreference&gt;
  &lt;/PreferenceCategory&gt;
    &lt;PreferenceCategory android:title="@string/pref.personal" android:order="2"&gt;
    &lt;EditTextPreference android:title="@string/search.customerNumber" android:key="myapp.wizard" android:inputType="textCapCharacters" android:maxLength="7"&gt;&lt;/EditTextPreference&gt;
    &lt;EditTextPreference android:title="@string/reservation.firstName" android:key="myapp.firstName" android:inputType="textCapWords|textPersonName"&gt;&lt;/EditTextPreference&gt;
    &lt;EditTextPreference android:title="@string/reservation.lastName" android:key="myapp.lastName" android:inputType="textCapWords|textPersonName"&gt;&lt;/EditTextPreference&gt;
    &lt;EditTextPreference android:title="@string/reservation.street" android:key="myapp.street" android:inputType="textCapWords|textPostalAddress"&gt;&lt;/EditTextPreference&gt;
    &lt;EditTextPreference android:title="@string/reservation.zip" android:key="myapp.zip" android:inputType="textCapWords|textPostalAddress"&gt;&lt;/EditTextPreference&gt;
    &lt;EditTextPreference android:title="@string/reservation.city" android:key="myapp.city" android:inputType="textCapWords"&gt;&lt;/EditTextPreference&gt;
    &lt;EditTextPreference android:title="@string/reservation.phone" android:key="myapp.phone" android:inputType="phone"&gt;&lt;/EditTextPreference&gt;
&lt;/PreferenceCategory&gt;
&lt;PreferenceCategory android:order="3"&gt;
    &lt;EditTextPreference android:title="@string/search.awdNumber" android:key="myapp.awd" android:inputType="textCapCharacters" android:maxLength="6"&gt;                    &lt;/EditTextPreference&gt;
    &lt;EditTextPreference android:title="@string/costControl.label" android:key="myapp.costControl" android:inputType="textCapWords" android:maxLength="15"&gt;&lt;/EditTextPreference&gt;
    &lt;/PreferenceCategory&gt;
&lt;/PreferenceScreen&gt;
</code></pre>

<p>For the release build I'm using ProGuard and there is already a line with</p>

<pre><code>-keep public class path.to.my.app.preferences.SeekBarPreference
</code></pre>

<p>in the config file.</p>

<p>Any useful tips for this?</p>
