java.lang.ClassNotFoundException after upgrading to SDK 21.1 and ADT 21.1
<p>I recently upgraded my eclipse with ADT 21.1.</p>

<p>I'm able to run apps as debug perfectly, but after exporting the apk and installing it on my smartphone it allways crashes, giving the follow error:</p>

<pre><code>java.lang.RuntimeException: Unable to instantiate application 
com.tapcrowd.app.TCApplication: java.lang.ClassNotFoundException: com.tapcrowd.app.TCApplication in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/mnt/asec/com.tapcrowd.ecommercebrasil-1/pkg.apk]
at android.app.LoadedApk.makeApplication(LoadedApk.java:466)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3264)
at android.app.ActivityThread.access$2200(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:973)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.tapcrowd.app.TCApplication in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/mnt/asec/com.tapcrowd.ecommercebrasil-1/pkg.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.app.Instrumentation.newApplication(Instrumentation.java:942)
at android.app.LoadedApk.makeApplication(LoadedApk.java:461)
... 11 more
</code></pre>

<p>TCApplication is correctly referenced in the manifest.</p>

<p>I have tried adding external libraries by putting them in the libs folder, removing and adding library projects with no succes.</p>

<p>How can I prevent the crash?</p>

<p>Manifest:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.tapcrowd.ecommercebrasil"
    android:installLocation="auto"
    android:versionCode="2"
    android:versionName="1.0.1" &gt;

    &lt;uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="16" /&gt;

    &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
    &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
    &lt;uses-permission android:name="android.permission.FLASHLIGHT" /&gt;
    &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
    &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
    &lt;uses-permission android:name="android.permission.SET_DEBUG_APP" /&gt;
    &lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt;

    &lt;!-- BEGIN GCM --&gt;
    &lt;permission
        android:name="com.tapcrowd.ecommercebrasil.permission.C2D_MESSAGE"
        android:protectionLevel="signature" /&gt;

    &lt;uses-permission android:name="com.tapcrowd.ecommercebrasil.permission.C2D_MESSAGE" /&gt;

    &lt;!-- App receives GCM messages. --&gt;
    &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
    &lt;!-- GCM connects to Google Services. --&gt;
    &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
    &lt;!-- GCM requires a Google account. --&gt;
    &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
    &lt;!-- Keeps the processor from sleeping when a message is received. --&gt;
    &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
    &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;

    &lt;!-- END GCM --&gt;

    &lt;uses-feature
        android:name="android.hardware.telephony"
        android:required="false" /&gt;
    &lt;uses-feature
        android:name="android.hardware.camera"
        android:required="false" /&gt;
    &lt;uses-feature
        android:name="android.hardware.camera.autofocus"
        android:required="false" /&gt;
    &lt;uses-feature
        android:name="android.hardware.location.gps"
        android:required="false" /&gt;
    &lt;uses-feature
        android:name="android.hardware.location"
        android:required="false" /&gt;

    &lt;application
        android:name="com.tapcrowd.app.TCApplication"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar" &gt;
        &lt;uses-library android:name="com.google.android.maps" /&gt;

        &lt;service android:name="com.tapcrowd.app.service.UpdateService" /&gt;
        &lt;service android:name=".GCMIntentService" /&gt;

        &lt;activity
            android:name="com.tapcrowd.app.Splash"
            android:label="@string/app_name"
            android:launchMode="singleInstance"
            android:screenOrientation="portrait" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;

                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;

          ...
    &lt;/application&gt;

&lt;/manifest&gt;
</code></pre>
