Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/Crash #307

Closed
Shidapu opened this issue Apr 21, 2023 · 1 comment
Closed

Bug/Crash #307

Shidapu opened this issue Apr 21, 2023 · 1 comment
Assignees
Labels
bug/limitation elsewhere Bug/limitation in the ROM or another project

Comments

@Shidapu
Copy link

Shidapu commented Apr 21, 2023

FATAL EXCEPTION: main
Process: com.chiller3.bcr, PID: 26209
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.chiller3.bcr/com.chiller3.bcr.SettingsActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4169)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4325)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(Unknown Source:676)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(SourceFile:6)
at androidx.appcompat.app.AppCompatActivity.setContentView(SourceFile:2)
at com.chiller3.bcr.SettingsActivity.onCreate(Unknown Source:6)
at android.app.Activity.performCreate(Activity.java:8591)
at android.app.Activity.performCreate(Activity.java:8570)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4150)
... 12 more

@chenxiaolong chenxiaolong self-assigned this Apr 22, 2023
@chenxiaolong chenxiaolong added the bug/limitation elsewhere Bug/limitation in the ROM or another project label Apr 22, 2023
@chenxiaolong
Copy link
Owner

Closing this in favor of #303 so I can track the issue in one place.

Please see my comment in that thread: #303 (comment)

chenxiaolong added a commit that referenced this issue Apr 23, 2023
Some devices seem to have an issue where (presumably) resources from an
old version are being used with new code. This causes BCR to crash with
an error about the app theme not being derived from Theme.AppCompat.
This commit works around the issue in a brute force way by deleting
BCR's dalvik cache and package manager cache entry on every boot.

Fixes: #275, #303, #307

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue May 2, 2023
Some devices seem to have an issue where (presumably) resources from an
old version are being used with new code. This causes BCR to crash with
an error about the app theme not being derived from Theme.AppCompat.
This commit works around the issue in a brute force way by deleting
BCR's package manager cache entry on every boot.

Fixes: #275, #303, #307

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue May 2, 2023
On some devices, the system time is set too late in the boot process.
This, for some reason, causes the package manager service to not update
the cache entry in /data/system/package_cache despite the mtime of the
apk being newer than the mtime of the cache entry [1]. The outdated
cache entry causes BCR to crash with an error about the app theme not
being derived from Theme.AppCompat. This commit works around the issue
in a brute force way by deleting BCR's package manager cache entry on
every boot.

[1] https://cs.android.com/android/platform/superproject/+/android-13.0.0_r42:frameworks/base/services/core/java/com/android/server/pm/parsing/PackageCacher.java;l=139

Fixes: #275, #303, #307

Signed-off-by: Andrew Gunnerson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/limitation elsewhere Bug/limitation in the ROM or another project
Projects
None yet
Development

No branches or pull requests

2 participants