编译调试-android-app闪退定位
代码
01-01 08:05:38.012 3471 3471 E AndroidRuntime: at com.example.lyj.f222222.MainActivity.onCreate(MainActivity.java:12)
解决办法
信息日志-(错误定位在第22行)
01-01 08:05:38.001 3471 3471 W art : Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 01-01 08:05:38.010 3471 3471 D AndroidRuntime: Shutting down VM 01-01 08:05:38.012 3471 3471 E AndroidRuntime: FATAL EXCEPTION: main 01-01 08:05:38.012 3471 3471 E AndroidRuntime: Process: com.example.lyj.f222222, PID: 3471 01-01 08:05:38.012 3471 3471 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.lyj.f222222/com.example.lyj.f222222.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.app.ActivityThread.access$800(ActivityThread.java:151) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.os.Looper.loop(Looper.java:135) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5254) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:906) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:701) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.support.v7.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:555) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:518) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:466) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at com.example.lyj.f222222.MainActivity.onCreate(MainActivity.java:12) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6002) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 01-01 08:05:38.012 3471 3471 E AndroidRuntime: ... 10 more 01-01 08:05:38.014 1586 2185 W ActivityManager: Force finishing activity 1 com.example.lyj.f222222/.MainActivity 01-01 08:05:38.015 3471 3471 I Process : Sending signal. PID: 3471 SIG: 9 01-01 08:05:38.061 1586 2174 I ActivityManager: Process com.example.lyj.f222222 (pid 3471) has died 01-01 08:05:38.063 1586 1613 E WindowState: getStack: Window{2ae577c3 u0 Starting com.example.lyj.f222222} couldn't find taskId=3 Callers=com.android.server.wm.WindowState.getDisplayContent:785 com.android.server.wm.WindowState.getWindowList:1357 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2784 com.android.server.wm.WindowManagerService.removeWindowLocked:2685 01-01 08:05:38.063 1586 1613 E WindowState: getStack: Window{2ae577c3 u0 Starting com.example.lyj.f222222} couldn't find taskId=3 Callers=com.android.server.wm.WindowState.getDisplayContent:785 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2789 com.android.server.wm.WindowManagerService.removeWindowLocked:2685 com.android.server.wm.WindowManagerService.removeWindow:2607 01-01 08:05:38.077 1116 1281 D : [GOPIoctl][11449] ERROR on cmd:0x501 01-01 08:05:38.080 2162 2162 W art : Attempt to remove local handle scope entry from IRT, ignoring 01-01 08:05:38.085 2162 2204 I Surface : Surface::setBuffersFormat format 1