Nain57 / Smart-AutoClicker

An open-source auto clicker on images for Android
GNU General Public License v3.0
2k stars 354 forks source link

Crash when starting a scenario on 2.4.2 #440

Closed empjustine closed 4 months ago

empjustine commented 4 months ago

Version of Smart AutoClicker

2.4.2

Device brand and model

Samsung A50 - product:a50dtvvj model:SM_A505GT device:a50

Version of your Android OS

11

Type

Smart scenario

Describe what happened?

App doesn't show overlay and doesn't respond after starting a scenario.

Except from stack trace after tapping the start scenario "play" button:

06-28 15:49:19.087 28151 28383 E AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-5
06-28 15:49:19.087 28151 28383 E AndroidRuntime: Process: com.buzbuz.smartautoclicker, PID: 28151
06-28 15:49:19.087 28151 28383 E AndroidRuntime: java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at android.os.Parcel.createExceptionOrNull(Parcel.java:2386)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at android.os.Parcel.createException(Parcel.java:2370)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at android.os.Parcel.readException(Parcel.java:2353)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at android.os.Parcel.readException(Parcel.java:2295)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at android.media.projection.IMediaProjection$Stub$Proxy.start(IMediaProjection.java:231)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at android.media.projection.MediaProjection.<init>(MediaProjection.java:68)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at android.media.projection.MediaProjectionManager.getMediaProjection(MediaProjectionManager.java:162)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at r2.j.c(SourceFile:127)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at f3.m.s(SourceFile:79)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at c8.a.o(SourceFile:9)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at r8.a0.run(SourceFile:116)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at androidx.appcompat.widget.j.run(SourceFile:18)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at x8.i.run(SourceFile:3)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at x8.a.run(SourceFile:94)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [h1{Cancelling}@4977057, Dispatchers.IO]
06-28 15:49:19.087 28151 28383 E AndroidRuntime: Caused by: android.os.RemoteException: Remote stack trace:
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at com.android.server.media.projection.MediaProjectionManagerService$MediaProjection.start(MediaProjectionManagerService.java:564)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at android.media.projection.IMediaProjection$Stub.onTransact(IMediaProjection.java:135)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at android.os.Binder.execTransactInternal(Binder.java:1190)
06-28 15:49:19.087 28151 28383 E AndroidRuntime:    at android.os.Binder.execTransact(Binder.java:1159)
06-28 15:49:19.087 28151 28383 E AndroidRuntime: 
06-28 15:49:19.090  4596  7419 W ActivityManager: crash : com.buzbuz.smartautoclicker,10297

Logs before crash from adb shell logcat -e 'com.buzbuz.smartautoclicker': https://gist.github.com/empjustine/8adfe8e60581739173b9f9cca9679879

Describe what should have happened?

Scenario control overlay shows up, allowing you to start or to configure a smart scenario.

Nain57 commented 4 months ago

Hi and thank you for your feedback.

I have seen this crash on crashlytics from ages, only on Samsung devices but I've never been able to find how to really fix it.

I have implemented a few solutions for it in the 3.0.0 beta version, but as I can't reproduce the issue, I'm not sure they are effective.

Can you try the latest beta version available here and see if it fixes your problem? https://github.com/Nain57/Smart-AutoClicker/releases/tag/3.0.0-beta04

empjustine commented 4 months ago

Automations in the latest beta build are working.

I however noticed 1 other issue while using the beta build: pressing the "pause" button in the overlay only half-works;

It looks like using the notification "show/hide" option twice fixes the "overlay toolbar" state.

Should I open another issue for that?

empjustine commented 4 months ago

It looks like this other issue already exists: https://github.com/Nain57/Smart-AutoClicker/issues/378, so I'm declaring this specific one as fixed.