我的Android应用程序不能在手机上工作,并且可以在模拟器上运行

时间:2016-10-01 03:53:00

标签: java android android-studio emulation

我制作了应用程序,它在我的android工作室模拟器上成功运行。 但是它停在我的手机上(不仅在我的手机上,也在另一部手机上),消息"应用程序意外停止"。所以我尝试使用基本活动安装空白应用程序,它也失败了。请帮帮我ToT

30887-30887/com.pbs.medicationmanager E/AndroidRuntime: FATAL EXCEPTION: main
   Process: com.pbs.medicationmanager, PID: 30887
   java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pbs.medicationmanager/com.pbs.medicationmanager.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:2205)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2255)
       at android.app.ActivityThread.access$800(ActivityThread.java:142)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1203)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5116)
       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:792)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
       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.<init>(AppCompatDelegateImplBase.java:83)
       at android.support.v7.app.AppCompatDelegateImplV7.<init>(AppCompatDelegateImplV7.java:146)
       at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:28)
       at android.support.v7.app.AppCompatDelegateImplV14.<init>(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.pbs.medicationmanager.MainActivity.onCreate(MainActivity.java:29)
       at android.app.Activity.performCreate(Activity.java:5275)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2255) 
       at android.app.ActivityThread.access$800(ActivityThread.java:142) 
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1203) 
       at android.os.Handler.dispatchMessage(Handler.java:102) 
       at android.os.Looper.loop(Looper.java:136) 
       at android.app.ActivityThread.main(ActivityThread.java:5116) 
       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:792) 
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608) 
       at dalvik.system.NativeStart.main(Native Method) 

1 个答案:

答案 0 :(得分:1)

更新 Gradle

buildscript {
  ...
  dependencies {
    classpath 'com.android.tools.build:gradle:2.1.0'
  }
}