2016-05-05 6 views
4

Wenn ich starten app es mir diesen FehlerErste Fehler "java.lang.NoClassDefFoundError: com.android.tools.fd.runtime.AppInfo"

FATAL EXCEPTION: main 
                java.lang.NoClassDefFoundError: com.android.tools.fd.runtime.AppInfo 
                 at com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:229) 
                 at android.app.Application.attach(Application.java:181) 
                 at android.app.Instrumentation.newApplication(Instrumentation.java:991) 
                 at android.app.Instrumentation.newApplication(Instrumentation.java:975) 
                 at android.app.LoadedApk.makeApplication(LoadedApk.java:504) 
                 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4417) 
                 at android.app.ActivityThread.access$1300(ActivityThread.java:141) 
                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) 
                 at android.os.Handler.dispatchMessage(Handler.java:99) 
                 at android.os.Looper.loop(Looper.java:137) 
                 at android.app.ActivityThread.main(ActivityThread.java:5103) 
                 at java.lang.reflect.Method.invokeNative(Native Method) 
                 at java.lang.reflect.Method.invoke(Method.java:525) 
                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 
                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
                 at dalvik.system.NativeStart.main(Native Method) 

Antwort

6

deaktivieren Instant-Run, löschen Sie die Build-Ordner und dann das Projekt neu erstellen. Sehen Sie, wenn es

1

In der Tat

Instant Run tries to do hot swapping of your code; this causes the application class to be moved.

https://developer.android.com/studio/run/index.html

Instant Run pushes updated code and resources to your connected device or emulator by performing a hot swap, warm swap, or cold swap.

So funktioniert werden Sie NoClassDefFoundError bekommen. Um das Problem zu lösen, können Sie entweder einen der folgenden Schritte ausführen:

1- Deaktivieren Sie Instant Run, indem Sie zu: Datei -> Einstellungen -> Build, Ausführung, Bereitstellung -> Instant Run ---> deaktivieren Sie "Aktivieren Sofortlauf " enter image description here Oder

2- Führen Sie die Reinigung und Neuerstellung der App durch.