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

Crash on Lineage OS 21 #539

Closed
2shrestha22 opened this issue May 5, 2024 · 13 comments · Fixed by #549
Closed

Crash on Lineage OS 21 #539

2shrestha22 opened this issue May 5, 2024 · 13 comments · Fixed by #549
Assignees
Labels
bug/limitation elsewhere Bug/limitation in the ROM or another project

Comments

@2shrestha22
Copy link

App does not start at all. It crashes immediately. I have attached log.

crash.log.txt

BRC: v1.62
Lineage OS: 20
Installation type: System (via flashable zip)

@chenxiaolong chenxiaolong self-assigned this May 5, 2024
@chenxiaolong
Copy link
Owner

Can you double check that the /system/etc/sysconfig/config-com.chiller3.bcr.xml file exists with a root file manager?

It's crashing because Android is denying BCR access to some system APIs. This config file is required to allow that access.

@1223421
Copy link

1223421 commented May 6, 2024

same problem, file /system/etc/sysconfig/config-com.chiller3.bcr.xml exists:

$ cat /system/etc/sysconfig/config-com.chiller3.bcr.xml
<?xml version="1.0" encoding="utf-8"?>
<config>
    <hidden-api-whitelisted-app package="com.chiller3.bcr" />
</config>

BRC: v1.62
Lineage OS: 21
Installation type: System (via flashable zip)

after first reboot it's work, after second reboot - crash

crash.log.txt

with 1.61 no problem.

@twu2
Copy link

twu2 commented May 7, 2024

same issue (No field SAMPLE_RATE_HZ_MIN) here (integrated with rom, not flash zip).
after flash rom, 1st boot work, but 2nd boot not working.
but sometimes, 1st boot not work, but 2nd boot working.

@chenxiaolong
Copy link
Owner

Please grab a logcat with adb logcat -d > logcat.txt after a reboot. (If you're able to grab one for a working boot and one for a non-working boot, even better.)

I don't really have any idea why the issue would be intermittent. Hopefully the logcat will have some indication as to why.

@2shrestha22
Copy link
Author

Can you double check that the /system/etc/sysconfig/config-com.chiller3.bcr.xml file exists with a root file manager?

It's crashing because Android is denying BCR access to some system APIs. This config file is required to allow that access.

Yes there is /system/etc/sysconfig/config-com.chiller3.bcr.xml

@twu2
Copy link

twu2 commented May 7, 2024

not working log:
logcat_not_working.txt

working log:
logcat_working.txt

@chenxiaolong
Copy link
Owner

Thanks for the logs. It confirms that the issue indeed is Android denying access to the hidden APIs:

(from logcat_not_working.txt)

05-07 11:29:50.910 28887 28887 W om.chiller3.bcr: Accessing hidden field Landroid/media/AudioFormat;->SAMPLE_RATE_HZ_MIN:I (max-target-o, reflection, denied)

I really have no idea why LineageOS is sometimes not respecting /system/etc/sysconfig/config-com.chiller3.bcr.xml. Since you're flashing directly and not using Magisk, the file always exists.


This is a total crapshoot, but can you give #541 a try? Test build: BCR-1.62.r9.g0b843bc-release.zip

It fixes a bug where the sysconfig file is deleted when flashing a LineageOS update without also flashing BCR again. I highly doubt it'll fix this issue though.

@twu2
Copy link

twu2 commented May 8, 2024

Using zip file as kernelsu module work fine for me. but integrated to rom might not working.
I found the zip put the files under /system, but integrated to rom put it under /product.
I change it to /system and build the rom again, it seems work fine now.

@radzix88
Copy link

radzix88 commented May 14, 2024

Thanks for the logs. It confirms that the issue indeed is Android denying access to the hidden APIs:

(from logcat_not_working.txt)

05-07 11:29:50.910 28887 28887 W om.chiller3.bcr: Accessing hidden field Landroid/media/AudioFormat;->SAMPLE_RATE_HZ_MIN:I (max-target-o, reflection, denied)

I really have no idea why LineageOS is sometimes not respecting /system/etc/sysconfig/config-com.chiller3.bcr.xml. Since you're flashing directly and not using Magisk, the file always exists.

This is a total crapshoot, but can you give #541 a try? Test build: BCR-1.62.r9.g0b843bc-release.zip

It fixes a bug where the sysconfig file is deleted when flashing a LineageOS update without also flashing BCR again. I highly doubt it'll fix this issue though.

It works for me only after first boot. After second boot it crashes again. LOS 21, flashed zip in TWRP, phone without root.
crash.log (7).txt
crash.log (6).txt

@twu2
Copy link

twu2 commented May 14, 2024

Using zip file as kernelsu module work fine for me. but integrated to rom might not working. I found the zip put the files under /system, but integrated to rom put it under /product. I change it to /system and build the rom again, it seems work fine now.

still get same error sometimes after this.
but if I got this issue, just install the apk again, then it will work.
so my workaround is: integrated the old version (1.61) to the rom, then install new version (1.62) again

@twu2
Copy link

twu2 commented May 16, 2024

still get same error sometimes after this. but if I got this issue, just install the apk again, then it will work. so my workaround is: integrated the old version (1.61) to the rom, then install new version (1.62) again

still got this sometimes after reboot.
but install apk again will make it work (uninstall it after install still working).
so I use a script to install and uninstall the apk after boot.

@chenxiaolong
Copy link
Owner

@twu2 It sounds like you're building your own ROM. If so, can you give this build a try? BCR-1.62.r19.gc4346df-release.zip (source code: c4346df)

This uses an alternative method of allowing access to system APIs. Maybe it'll avoid this OS bug where the sysconfig file is sometimes ignored.

When testing, please don't use any workarounds (like installing the apk as a user app). Also, please delete the sysconfig file because the new method doesn't use it.

@chenxiaolong chenxiaolong added the bug/limitation elsewhere Bug/limitation in the ROM or another project label May 20, 2024
@twu2
Copy link

twu2 commented May 21, 2024

@twu2 It sounds like you're building your own ROM. If so, can you give this build a try? BCR-1.62.r19.gc4346df-release.zip (source code: c4346df)

This uses an alternative method of allowing access to system APIs. Maybe it'll avoid this OS bug where the sysconfig file is sometimes ignored.

When testing, please don't use any workarounds (like installing the apk as a user app). Also, please delete the sysconfig file because the new method doesn't use it.

this build work fine for me.

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

Successfully merging a pull request may close this issue.

5 participants