为什么编译的APP运行是秒退
为什么编译的APP运行是秒退
By cn22
at 2016-04-07
0人收藏 • 12306人看过
为什么编译的APP运行是秒退
- 登录后方可回帖
40 个回复 | 最后更新于 2016-08-08
回复#1 @lincanbin :
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
项目拿到手,app里面的build.gradle的包是这样的
compile 'com.android.support:design:23.2'
如果不修改成
compile 'com.android.support:design:23.2.0'
会提示没有这个包,不知道是不是这个原因,我是linux mint系统的android studio
@lincanbin
回复#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" }}
回复#8 @cn22 :
我也查到了,我这边正在看。
回复#11 @cn22 :
我当然能,之前也能,我AS版本2.0。
回复#12 @lincanbin :
sdk和as我都下载最新了,还是秒退
回复 #14 @cn22 :
好吧,我再看看。
回复#16 @xiaolzh :
事实上只要有最新版的Android Studio,就不会出现这个问题。