BatteryChargeLimiter icon indicating copy to clipboard operation
BatteryChargeLimiter copied to clipboard

App crashes when enabling

Open recallmenot opened this issue 1 year ago • 15 comments

On a rooted hotdog (One Plus 7 Pro), when I enable the limit, the app crashes, and from then on every time I want to open it. Have to reinstall it from fdroid to be able to open it again. Latest crdroid (android 13). https://paste.crdroid.net/qWWbKG

recallmenot avatar Mar 23 '23 16:03 recallmenot

repeated the experiment with the second file from: https://github.com/MuntashirAkon/BatteryChargeLimiter/issues/21, existence verified with TotalCommander same result: https://paste.crdroid.net/irDvbO

recallmenot avatar Mar 23 '23 17:03 recallmenot

Same issue on OnePlus 8T with Android 13 (LineageOS 20)

Kelvino9 avatar Jun 09 '23 13:06 Kelvino9

I got the same issue when installing from the release in this repo, but I didn't get it when compiling from source

lord-ne avatar Jun 14 '23 19:06 lord-ne

I have the same problem, probably related. Android 13 (CalyxOS) Pixel 7 Pro, Magisk 26.1 Zygisk Error: java.lang.IllegalArgumentException: io.github.muntashirakon.bcl: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. at android.app.PendingIntent.checkFlags(PendingIntent.java:401) at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:671) at android.app.PendingIntent.getBroadcast(PendingIntent.java:658) at io.github.muntashirakon.bcl.EnableWidget.buildButtonPendingIntent(EnableWidget.kt:2) at io.github.muntashirakon.bcl.EnableWidget.updateWidget(EnableWidget.kt:3) at io.github.muntashirakon.bcl.activities.MainFragment$$ExternalSyntheticLambda3.onCheckedChanged(Unknown Source:21) at android.widget.CompoundButton.setChecked(CompoundButton.java:222) at androidx.appcompat.widget.SwitchCompat.setChecked(SwitchCompat.java:1) at androidx.appcompat.widget.SwitchCompat.toggle(SwitchCompat.java:1) at android.widget.CompoundButton.performClick(CompoundButton.java:144) at android.view.View.performClickInternal(View.java:7483) at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0) at android.view.View$PerformClick.run(View.java:29357) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7884) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

upbox-org avatar Jun 18 '23 20:06 upbox-org

Also crashing for Android 12, if you turn on "Enable charge limit option". After that it crashing just by clicking the app icon from launcher. App version : 1.0.0

Logs

FATAL EXCEPTION: main
Process: io.github.muntashirakon.bcl, PID: 32235
java.lang.IllegalArgumentException: io.github.muntashirakon.bcl: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
	at android.app.PendingIntent.checkFlags(PendingIntent.java:377)
	at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:647)
	at android.app.PendingIntent.getBroadcast(PendingIntent.java:634)
	at io.github.muntashirakon.bcl.EnableWidget.buildButtonPendingIntent(EnableWidget.kt:2)
	at io.github.muntashirakon.bcl.EnableWidget.updateWidget(EnableWidget.kt:3)
	at io.github.muntashirakon.bcl.activities.MainFragment$$ExternalSyntheticLambda3.onCheckedChanged(Unknown Source:21)
	at android.widget.CompoundButton.setChecked(CompoundButton.java:222)
	at androidx.appcompat.widget.SwitchCompat.setChecked(SwitchCompat.java:1)
	at io.github.muntashirakon.bcl.activities.MainFragment.onStart(MainFragment.kt:3)
	at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:8)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:11)
	at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:73)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:5)
	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:22)
	at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:1)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1457)
	at android.app.Activity.performStart(Activity.java:8259)
	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3776)
	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2311)
	at android.os.Handler.dispatchMessage(Handler.java:111)
	at android.os.Looper.loopOnce(Looper.java:238)
	at android.os.Looper.loop(Looper.java:357)
	at android.app.ActivityThread.main(ActivityThread.java:8090)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1026)

shuvashish76 avatar Sep 22 '23 13:09 shuvashish76

it also doesn't work with Xiaomi note 11 MIUI 14 android 13 But with miui 14 android 12 still works

Looking forward to having it fixed

chientarget avatar Sep 30 '23 05:09 chientarget

Sorry, I quite forgot about the issue. I'll publish a new release in the next week if I'm available.

MuntashirAkon avatar Sep 30 '23 05:09 MuntashirAkon

Same problem still persisting - whats the status of the new release?

ford--prefect avatar Oct 13 '23 08:10 ford--prefect

Unfortunately, I've become too busy to make any open source contribution this month. I'll see if I can do it in the weekend.

MuntashirAkon avatar Oct 13 '23 16:10 MuntashirAkon

I don't want to be a pest but the month (and hopefully your stressful time) has past. Any prospect to get a release done? Thanks and don't feel pressed, please.

ford--prefect avatar Nov 07 '23 14:11 ford--prefect

Does anyone have a working apk? @lord-ne you say you fixed it by compiling yourself. Could you maybe share your apk?

hapklaar avatar Dec 12 '23 19:12 hapklaar

Facing the same issue. Pixel 7, A14, Stock ROM

Is there any update?

varad-kadam avatar Feb 25 '24 22:02 varad-kadam

Facing the same issue. Pixel 7, A14, Stock ROM

Is there any update?

I had great success on my old Samsung tablet with this app: https://github.com/sriharshaarangi/BatteryChargeLimit. Might want to try that.

hapklaar avatar Feb 25 '24 23:02 hapklaar

I had great success on my old Samsung tablet with this app: https://github.com/sriharshaarangi/BatteryChargeLimit. Might want to try that.

I believe this app is forked from the same and ment to be an update. However, I'll try it out as well, fingers crossed there are no issues.

varad-kadam avatar Feb 26 '24 03:02 varad-kadam

for anyone interested:

AccA works for me.

https://github.com/MatteCarra/AccA

https://f-droid.org/en/packages/mattecarra.accapp/

recallmenot avatar Feb 27 '24 13:02 recallmenot

Fixed in ea9cdc03d9c043d9e8da6dd053203c4bced4ecba

MuntashirAkon avatar Jul 04 '24 14:07 MuntashirAkon

yippee !!

theotheroracle avatar Jul 04 '24 16:07 theotheroracle