AuthSettingsActivity crashes on launch (InflateException: Material attributes under AppCompat theme)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
Direzione di ricerca
Il crash si verifica in AuthSettingsActivity durante l’inflazione di layout/activity_auth_settings.xml perché vengono utilizzati attributi Material 3 con un tema AppCompat. Controlla res/values/styles.xml per vedere la definizione di AppTheme. Cambia il parent in Theme.MaterialComponents.Light.NoActionBar oppure sostituisci gli attributi Material nel layout con equivalenti AppCompat. Avvia l’app e vai a Settings per verificare la correzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Kotlin
- Stelle
- 270
- Fork
- 57
- Merge medio
- 23h 47m
- PR unite (30g)
- 39
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ActivityWatch/aw-android
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ActivityWatch/aw-android#306 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
ActivityWatch/aw-android#302 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
ActivityWatch/aw-android#300 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
ActivityWatch/aw-android#296 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
ActivityWatch/aw-android#291 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ActivityWatch/aw-android
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
detekt/detekt#9761 · 1 commento · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
yschimke/compose-preview-server#1163 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
T31n/YagniLauncher#1051 ·
I maintainer di solito rispondono entro 1 giorno