-1

I am new Android developer and I am facing below error while running my application in my device. Can anyone please help me regarding below error. Your help would be appreciated.

E/AndroidRuntime: FATAL EXCEPTION: main
                                                                 Process: test1.uitflashlight, PID: 28312
                                                                 java.lang.RuntimeException: Unable to start activity ComponentInfo{test1.uitflashlight/test1.uitflashlight.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2345)
                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)
                                                                     at android.app.ActivityThread.access$800(ActivityThread.java:149)
                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1324)
                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                     at android.os.Looper.loop(Looper.java:211)
                                                                     at android.app.ActivityThread.main(ActivityThread.java:5319)
                                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                                     at java.lang.reflect.Method.invoke(Method.java:372)
                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
                                                                  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:359)
                                                                     at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:328)
                                                                     at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:289)
                                                                     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
                                                                     at test1.uitflashlight.MainActivity.onCreate(MainActivity.java:23)
                                                                     at android.app.Activity.performCreate(Activity.java:5933)
                                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
                                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
                                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405) 
                                                                     at android.app.ActivityThread.access$800(ActivityThread.java:149) 
                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1324) 
                                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                     at android.os.Looper.loop(Looper.java:211) 
                                                                     at android.app.ActivityThread.main(ActivityThread.java:5319) 
                                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                                     at java.lang.reflect.Method.invoke(Method.java:372) 
                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016) 
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811) 

Manifest File

Kuls
  • 2,047
  • 21
  • 39
E1337K
  • 1
  • 2

1 Answers1

0

The Error is shown on the Log Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

The Activity must use App.Theme or its Descendants on the AndroidManifest.xml

android:theme="@style/Theme"

as Theme Extends from Theme.AppCompat

Itzik Samara
  • 2,278
  • 1
  • 14
  • 18
  • Can u give me some more informations like what to change im a little bit bad with english :D – E1337K Sep 30 '17 at 14:00