AuthSettingsActivity crashes on launch (InflateException: Material attributes under AppCompat theme)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
調査の方向性
AppCompat テーマで Material 3 属性が使用されているため、layout/activity_auth_settings.xml のインフレート時に AuthSettingsActivity でクラッシュが発生します。AppTheme の定義を確認するために res/values/styles.xml を確認してください。parent を Theme.MaterialComponents.Light.NoActionBar に変更するか、レイアウト内の Material 属性を AppCompat 相当の属性に置き換えてください。アプリを実行し、Settings に移動して修正を検証してください。
索引モデルが issue の本文から書いたものです。
説明
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
- Install v0.14.0dev20260723 on Android 14
- Complete onboarding, open
MainActivity - Open the options menu (
KEYCODE_MENU; there is no visible affordance under gesture
navigation — see note below) - 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.<init>(TextView.java:1468)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:115)
Root cause
res/layout/activity_auth_settings.xml uses Material Components 3 theme attributes:
<!-- lines 36-43 -->
<TextView
android:id="@+id/tv_status"
...
android:textAppearance="?attr/textAppearanceBodySmall"
android:textColor="?attr/colorOnSurfaceVariant"
android:text="Checking…" />
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:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
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.xmlis 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:
<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.
- 主要言語
- Kotlin
- スター
- 275
- フォーク
- 60
- 平均マージ
- 20時間 32分
- マージ済み PR(30日)
- 38
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ActivityWatch/aw-android のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ActivityWatch/aw-android#306 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
ActivityWatch/aw-android#302 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
ActivityWatch/aw-android#300 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
ActivityWatch/aw-android#296 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
ActivityWatch/aw-android#291 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
ActivityWatch/aw-android の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
Source is down
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
keiyoushi/extensions-source#19491 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100