LuckSiege / LuckSiege/PictureSelector

Unable to start activity ComponentInfo{com.jian.wan/com.luck.picture.lib.basic.PictureSelectorSupporterActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

Open
#2,728 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
13.6k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

## Current use version?
#### 当前使用的版本是多少?

```
当前使用版本3.11.1
```

## Will this problem occur in demo?
#### Demo能否复现这问题?

```
可以复现
```

## Describe the problem or provide an error log?
#### 描述问题或提供错误log?

```
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jian.wan/com.luck.picture.lib.basic.PictureSelectorSupporterActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3825)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3971)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2389)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8261)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:856)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:819)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:707)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
at com.luck.picture.lib.basic.PictureSelectorSupporterActivity.onCreate(PictureSelectorSupporterActivity.java:36)
at android.app.Activity.performCreate(Activity.java:8516)
at android.app.Activity.performCreate(Activity.java:8480)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1418)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3806)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3971) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2389) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loopOnce(Looper.java:210) 
at android.os.Looper.loop(Looper.java:299) 
at android.app.ActivityThread.main(ActivityThread.java:8261) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954) 

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at PictureSelectorSupporterActivity.onCreate, reported at line 36, and reproduce the launch failure in the demo. Trace the activity startup and theme configuration involved in the AppCompat exception; done means the demo can launch this activity without the reported IllegalStateException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.