ActivityWatch / ActivityWatch/aw-android
AuthSettingsActivity crashes on launch (InflateException: Material attributes under AppCompat theme)
- 主要言語
- Kotlin
- スター
- 265
- フォーク
- 57
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 19
説明
# AuthSettingsActivity crashes on launch (InflateException: Material attributes under AppCompat theme)
**Repository:** ActivityWatch/aw-android
**Version:** v0.14.0dev20260723 (versionCode 37)
**Device:** Samsung Galaxy S21 FE 5G (SM-G990B2), Android 14, One UI
## Summary
The API key settings screen cannot be opened. Selecting **Settings** from the options
menu launches `AuthSettingsActivity`, which immediately crashes with an
`InflateException`. The activity is killed by the system and the app returns to the
launcher.
This makes the API key unreadable, so no external client can authenticate against the
device's `aw-server`. It also makes the *"disable authentication"* toggle unreachable,
since that switch lives on the same screen — there is currently no way to either obtain
the key or opt out of authentication.
## Steps to reproduce
1. Install v0.14.0dev20260723 on Android 14
2. Complete onboarding, open `MainActivity`
3. Open the options menu (`KEYCODE_MENU`; there is no visible affordance under gesture
navigation — see note below)
4. Select **Settings**
Reproduces every time.
## Stack trace
```
FATAL EXCEPTION: main
Process: net.activitywatch.android, PID: 30777
java.lang.RuntimeException: Unable to start activity
ComponentInfo{net.activitywatch.android/net.activitywatch.android.AuthSettingsActivity}:
android.view.InflateException: Binary XML file line #43 in
net.activitywatch.android:layout/activity_auth_settings: Error inflating class TextView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4164)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322)
...
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 5:
TypedValue{t=0x2/d=0x7f030117 a=-1},
theme={InheritanceMap=[... net.activitywatch.android:style/AppTheme,
... style/Theme.AppCompat.Light.NoActionBar, ...]}
at android.content.res.TypedArray.getColorStateList(TypedArray.java:600)
at android.widget.TextView.readTextAppearance(TextView.java:4535)
at android.widget.TextView.(TextView.java:1468)
at androidx.appcompat.widget.AppCompatTextView.(AppCompatTextView.java:115)
```
## Root cause
`res/layout/activity_auth_settings.xml` uses Material Components 3 theme attributes:
```xml
```
The layout additionally references `?attr/textAppearanceBodyLarge`,
`?attr/textAppearanceBodyMedium`, `?attr/textAppearanceLabelLarge` and instantiates
`com.google.android.material.switchmaterial.SwitchMaterial`.
None of these resolve under the app's theme, which is defined in
`res/values/values.xml`/`styles.xml` as:
```xml
```
`Theme.AppCompat.*` does not define the Material 3 attribute set, so attribute resolution
fails during inflation.
## Why this affects all current builds
- `activity_auth_settings.xml` is unchanged since it was added in
"feat(auth): add API key settings screen" (2026-06-29)
- The app theme is unchanged since 2023
Consequently every build that contains the auth screen is affected, including the current
`master` and the CI artifacts from 2026-07-28. I verified this before attempting an
upgrade, so upgrading is not a workaround.
## Suggested fix
Either point the theme at Material Components:
```xml
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
```
(this is also required for `SwitchMaterial` to behave correctly), or replace the Material
attributes in `activity_auth_settings.xml` with AppCompat-compatible equivalents such as
`?attr/textAppearanceListItemSecondary` and `?android:attr/textColorSecondary`.
The theme change is the smaller diff, but worth checking against the other layouts for
visual regressions.
## Minor, related observation
The menu entry that launches this activity is `R.id.action_settings` in the *options*
menu. On devices using gesture navigation there is no hardware or on-screen menu button,
so the entry is unreachable through normal interaction — it can only be triggered via
`adb shell input keyevent KEYCODE_MENU`. Moving it into the navigation drawer (next to
the existing "Settings" entry, which opens the web UI settings) would make it discoverable.
## Impact
With authentication enabled by default and the settings screen unreachable, the device's
`aw-server` is effectively closed to external clients. `GET /api/0/info` and `/` respond,
everything under `/api/0/buckets/` returns 401. Reaching the server itself is not the
problem — `adb forward tcp:5601 tcp:5600` works fine — only authentication is.
Other routes to the key were checked and are dead ends: `config.toml` lives in internal
storage and the release APK is not debuggable (`run-as` refused), `adb backup` returns an
empty archive on Android 12+, and `BackgroundService` is `exported="false"` so it cannot
be started in isolation.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。