为什么编译的APP运行是秒退
By
cn22
at 2016-04-07 • 0人收藏 • 12322人看过
为什么编译的APP运行是秒退
40 个回复 | 最后更新于 2016-08-08
Landroid/widget/LinearLayout$LayoutParams;.<init> (Landroid/widget/LinearLayout$LayoutParams;)V 04-07 01:39:17.042 832-832/com.lincanbin.carbonforum W/dalvikvm: VFY: unable to resolve direct method 19763: Landroid/widget/LinearLayout$LayoutParams;.<init> (Landroid/widget/LinearLayout$LayoutParams;)V 04-07 01:39:17.292 832-832/com.lincanbin.carbonforum W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41465730) 04-07 01:39:17.432 832-832/com.lincanbin.carbonforum E/AndroidRuntime: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lincanbin.carbonforum/com.lincanbin.carbonforum.IndexActivity}: android.view.InflateException: Binary XML file line #26: Error inflating class android.support.design.widget.FloatingActionButton at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) at android.app.ActivityThread.access$600(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 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) Caused by: android.view.InflateException: Binary XML file line #26: Error inflating class android.support.design.widget.FloatingActionButton
回复#7 @lincanbin :
关于 vectorDrawables
经过一夜的google调查,如果android studio 的gradle plugin是2.0以上才能使用
vectorDrawables.useSupportLibrary = true
否则要改成
android { defaultConfig { // Stops the Gradle plugin’s automatic rasterization of vectors generatedDensities = [] } // Flag to tell aapt to keep the attribute ids around aaptOptions { additionalParameters "--no-version-vectors" }}
登录后方可回帖
查看崩溃日志即可,你不说你改了哪里,没截图没错误日志。
我怎么知道为什么秒退?