android: fix AppCompat theme crash on launch
This commit is contained in:
@@ -994,3 +994,13 @@
|
||||
- copies `*Application_GeneratedInjector.class` from `intermediates/javac/.../classes`
|
||||
into `intermediates/classes/.../transform...ClassesWithAsm/dirs` if missing,
|
||||
- wired task as dependency of `dexBuilder<Variant>`.
|
||||
|
||||
### Step 135 - AppCompat launch crash fix (theme mismatch)
|
||||
- Fixed `MainActivity` startup crash:
|
||||
- `IllegalStateException: You need to use a Theme.AppCompat theme`.
|
||||
- Root cause:
|
||||
- `Theme.AppCompat.DayNight.NoActionBar` was accidentally overridden in app resources
|
||||
with non-AppCompat parent (`Theme.DeviceDefault.NoActionBar`).
|
||||
- Fix applied:
|
||||
- introduced dedicated app theme `Theme.Messenger` with parent `Theme.AppCompat.DayNight.NoActionBar`,
|
||||
- switched `AndroidManifest.xml` application theme to `@style/Theme.Messenger`.
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:roundIcon="@android:drawable/sym_def_app_icon"
|
||||
android:supportsRtl="true"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar">
|
||||
android:theme="@style/Theme.Messenger">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Theme.AppCompat.DayNight.NoActionBar" parent="@android:style/Theme.DeviceDefault.NoActionBar" />
|
||||
<style name="Theme.Messenger" parent="Theme.AppCompat.DayNight.NoActionBar" />
|
||||
<integer name="google_play_services_version">12451000</integer>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user