Crash: IllegalStateException in AppContext.getLiveValue

未關閉
#343 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@Tarquinen 已經在處理了。

開始於 2026年11月28日。

  • #344 來自 @Tarquinen —— 未關閉

評估

難度
3/5
預估耗時
半天
新手友好度
65/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
android, kotlin
領域
mobile-dev

研究方向

Start with ai.opencode.core.dependencies.AppContext.getLiveValue in AppContext.java, then follow the dependency initialization through DependencyValues.kt, AppFeatureMigrations.kt, and MainActivity.kt as shown in the stack trace. Reproduce the startup path and identify why the live dependency value throws IllegalStateException. The change is done when the affected startup path no longer crashes and the relevant dependency lifecycle behavior is covered by a test.

由索引模型根據 Issue 內容生成。

描述

crash crash-triaged

Google Play reported this crash (Android vitals).

  • Exception: java.lang.IllegalStateException
  • Where: ai.opencode.core.dependencies.AppContext.getLiveValue
  • Last 7 days: 2 reports from about 2 users
  • Version codes: 380–1015
  • Android API levels: 34–36
  • Last seen: 2026-11-27
  • Sample: Samsung Galaxy A72, Android API 34, version code 380, commit 82079247e
Exception java.lang.RuntimeException
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:4164)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:4322)
  at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:103)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:139)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:96)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2685)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:230)
  at android.os.Looper.loop (Looper.java:319)
  at android.app.ActivityThread.main (ActivityThread.java:8919)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:578)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
  at ai.opencode.core.dependencies.AppContext.getLiveValue (AppContext.java:20)
  at ai.opencode.core.dependencies.AppContext.getLiveValue (AppContext.java:18)
  at ai.opencode.core.dependencies.DependencyValues$Companion.live (DependencyValues.java:65)
  at ai.opencode.core.dependencies.DependencyValues$Companion.access$live (DependencyValues.java:60)
  at ai.opencode.core.dependencies.DependencyValues.get (DependencyValues.kt:35)
  at ai.opencode.core.dependencies.DependencyValuesKt.dependency (DependencyValues.kt:135)
  at ai.opencode.core.sharing.LiveSharedBytes$Companion.create (LiveSharedBytes.java:185)
  at ai.opencode.core.sharing.SharedStore.liveValue_delegate$lambda$0 (SharedStore.java:150)
  at kotlin.SynchronizedLazyImpl.getValue (LazyJVM.kt:86)
  at ai.opencode.core.sharing.SharedStore$Key.getLiveValue (SharedStore.java:150)
  at ai.opencode.core.sharing.SharedStore$Key.getLiveValue (SharedStore.java:149)
  at ai.opencode.core.dependencies.DependencyValues$Companion.live (DependencyValues.java:65)
  at ai.opencode.core.dependencies.DependencyValues$Companion.access$live (DependencyValues.java:60)
  at ai.opencode.core.dependencies.DependencyValues.get (DependencyValues.kt:35)
  at ai.opencode.core.dependencies.DependencyValuesKt.dependency (DependencyValues.kt:135)
  at ai.opencode.app.AppFeatureMigrationsKt.migrateBeforeRestore (AppFeatureMigrations.kt:58)
  at ai.opencode.app.AppFeature$State$Companion.initial (AppFeature.java:278)
  at ai.opencode.app.RootStore.resolve$lambda$0 (RootStore.java:245)
  at ai.opencode.app.RootStore.resolve (RootStore.java:261)
  at ai.opencode.app.RootStore.resolve (RootStore.java:244)
  at ai.opencode.app.MainActivity.onCreate (MainActivity.kt:100)
  at android.app.Activity.performCreate (Activity.java:8975)
  at android.app.Activity.performCreate (Activity.java:8944)
  at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1456)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:4146)

Play Console (needs access):

主要語言
Kotlin
星號
146
分支
35
平均合併
7 小時 41 分鐘
30 天內合併 PR
221

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

anomalyco/opencode-android 的其他 Issue

查看 anomalyco/opencode-android 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。