2 max xjf Max_XJF 于 2016.09.08 10:16 提问

android studio 新建项目运行报错

Logcat 报错如下:

09-08 10:11:56.694 6639-6639/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.max.myapplication, PID: 6639
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.max.myapplication/com.max.myapplication.MainActivity}: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2219)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5045)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:692)
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:186)
at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
at android.support.v7.app.AppCompatDelegateImplBase.(AppCompatDelegateImplBase.java:83)
at android.support.v7.app.AppCompatDelegateImplV7.(AppCompatDelegateImplV7.java:146)
at android.support.v7.app.AppCompatDelegateImplV11.(AppCompatDelegateImplV11.java:28)
at android.support.v7.app.AppCompatDelegateImplV14.(AppCompatDelegateImplV14.java:41)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:193)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:173)
at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:511)
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
at com.max.myapplication.MainActivity.onCreate(MainActivity.java:10)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2163)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5045) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
at dalvik.system.NativeStart.main(Native Method) 
09-08 10:11:58.562 6639-6639/? I/Process: Sending signal. PID: 6639 SIG: 9
**

2个回答

Max_XJF
Max_XJF   2016.09.08 10:30

已解决,把MainActivity的AppCompatActivity改成Activity

kaifali
kaifali 怎么修改啊?求指教。我把MainActivity.java里的AppCompatActivity都改成Activity就报错
大约一年之前 回复
v587095554
v587095554   2016.10.21 13:47

产生的原因是:com.android.support:appcompat-v7与rasterized vectors不兼容,gradle2.0及其之上,library的资源没有栅格化,所以不会发生这个问题
http://www.cnblogs.com/davidgu/p/5973846.html

Csdn user default icon
上传中...
上传图片
插入图片