steve1316 / granblue-automation-android

Educational application written in Kotlin aimed at automating user-defined workflows for the mobile game, "Granblue Fantasy", using MediaProjection, AccessibilityService, and OpenCV.
63 stars 11 forks source link

Bot crash when pressing Stop button #21

Closed steve1316 closed 1 year ago

steve1316 commented 2 years ago

Possibly found the reason why the bot sometimes crashes when the Stop button is pressed using the Flipper debugging tool. Also need to implement solution to the framework as well.

FATAL EXCEPTION: main

java.util.ConcurrentModificationException

FATAL EXCEPTION: main
Process: com.steve1316.granblue_automation_android, PID: 16939
java.util.ConcurrentModificationException
    at java.util.ArrayList$Itr.next(ArrayList.java:860)
    at com.steve1316.granblue_automation_android.utils.MessageLog$Companion.saveLogToFile(MessageLog.kt:92)
    at com.steve1316.granblue_automation_android.utils.BotService.performCleanUp(BotService.kt:234)
    at com.steve1316.granblue_automation_android.utils.BotService.performCleanUp$default(BotService.kt:230)
    at com.steve1316.granblue_automation_android.utils.BotService$onCreate$1.onTouch(BotService.kt:182)
    at android.view.View.dispatchTouchEvent(View.java:15072)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3923)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3597)
    at android.view.View.dispatchPointerEvent(View.java:15335)
    at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:7680)
    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7453)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6788)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6845)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6811)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:7009)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6819)
    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:7066)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6792)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6845)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6811)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6819)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6792)
    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:10220)
    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:10068)
    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:10024)
    at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:10352)
    at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
    at android.os.MessageQueue.nativePollOnce(Native Method)
    at android.os.MessageQueue.next(MessageQueue.java:335)
    at android.os.Looper.loopOnce(Looper.java:186)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8641)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)
steve1316 commented 1 year ago

Closing this issue for now. Have not encountered it since and there had been major revisions to the underlying framework since then so this is probably fixed by accident.