Gradle插件2.1.0:应用程序在启动时崩溃

时间:2016-05-05 20:23:40

标签: android android-studio android-gradle

当我运行应用程序时,应用程序崩溃。 我正在使用新的Android插件2.1.0

Failed to create directory /data/data/ric.es.pruebavideo/files/instant-run/dex
05-05 

Couldn't create dex code folder

05-05 22:13:05.024 28257-28257/ric.es.pruebavideo D/AndroidRuntime: Shutting down VM
05-05 22:13:05.026 28257-28257/ric.es.pruebavideo E/AndroidRuntime: FATAL EXCEPTION: main
                                                                    Process: ric.es.pruebavideo, PID: 28257
                                                                    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{ric.es.pruebavideo/ric.es.pruebavideo.VideoRActivity}: java.lang.ClassNotFoundException: Didn't find class "ric.es.pruebavideo.VideoRActivity" on path: DexPathList[[zip file "/data/app/ric.es.pruebavideo-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2236)
                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
                                                                        at android.app.ActivityThread.access$800(ActivityThread.java:151)
                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
                                                                        at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                        at android.os.Looper.loop(Looper.java:135)
                                                                        at android.app.ActivityThread.main(ActivityThread.java:5254)
                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                        at java.lang.reflect.Method.invoke(Method.java:372)
                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
                                                                     Caused by: java.lang.ClassNotFoundException: Didn't find class "ric.es.pruebavideo.VideoRActivity" on path: DexPathList[[zip file "/data/app/ric.es.pruebavideo-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.app.Instrumentation.newActivity(Instrumentation.java:1066)
                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2226)
                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
                                                                        at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                                        at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                        at android.os.Looper.loop(Looper.java:135) 
                                                                        at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                                        at java.lang.reflect.Method.invoke(Native Method) 
                                                                        at java.lang.reflect.Method.invoke(Method.java:372) 
                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
                                                                        Suppressed: java.lang.ClassNotFoundException: ric.es.pruebavideo.VideoRActivity
                                                                        at java.lang.Class.classForName(Native Method)
                                                                        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
                                                                        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
                                                                        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                                                                                ... 13 more
                                                                     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
05-05 22:18:21.137 29791-29791/ric.es.pruebavideo D/Mobility: Selected camera resolution: 1280 x 720
05-05 22:18:21.210 29791-29791/ric.es.pruebavideo I/Choreographer: Skipped 30 frames!  The application may be doing too much work on its main thread.

1 个答案:

答案 0 :(得分:2)

将grudle降级为2.0.0对我有用