minsdkVersion 17但在4.4.2中表现出

时间:2018-08-21 08:53:12

标签: java android android-layout android-studio illegalstateexception

错误

FATAL EXCEPTION: main
Process: com.appmaster.akash.messageplus, PID: 28886
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.appmaster.akash.messageplus/com.appmaster.akash.messageplus.MainActivity}:
    java.lang.IllegalStateException:
    You need to use a Theme.AppCompat theme (or descendant) with this activity.
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2338)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
    at android.app.ActivityThread.access$800(ActivityThread.java:151)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
    at android.os.Handler.dispatchMessage(Handler.java:110)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:5292)
    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:824)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
    at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:354)
    at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:323)
    at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
    at com.appmaster.akash.messageplus.MainActivity.onCreate(MainActivity.java:72)
    at android.app.Activity.performCreate(Activity.java:5264)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)

我最近想在新设备上尝试该应用程序,但收到此错误...该设备在4.4.2上运行但仍然崩溃...

错误行指向

 setContentView(R.layout.activity_main);

0 个答案:

没有答案