0

I am working on a mobile application in Flutter to

  • create a Bluetooth connection
  • receive data from this device
  • plot them on the screen using SfCartesianChart

Everything works fine, except that after a while, the application freezes completely. There is nothing I can do but quit the application. I have looked at the "Flutter performance" section, but I can't find any useful indication. Also, I don't see any errors on my command line. It is a total mystery. I keep looking but it's hopeless.

Well, I never understand why people are giving a "-1" instead of explaining something but I appreciate your suggestions on how I can resolve this error.

  • Are you running it in debug mode? – DEFL Jun 15 '22 at 18:06
  • Hello @EnviroApps, no – display_name Jun 15 '22 at 19:03
  • Well you should definitely try that otherwise in release mode its not showing the logs depending on your config. – DEFL Jun 16 '22 at 07:31
  • Thank you for your answer @EnviroApps. Can you tell me what should I be looking for in debug mode? Are you talking about "Standard logging events" stated in https://docs.flutter.dev/development/tools/devtools/logging? – display_name Jun 16 '22 at 08:26
  • As you stated in your answer you don't see any logs right? So you can't figure out why the app is freezing as you have no logs. Since you are running your app in release mode its normally not displaying all logs. So if you run it in debug mode you can check the last logs before freezing and see what it states. For debugging you can either use devtools or as I would suggest your IDE – DEFL Jun 16 '22 at 09:59
  • I tested debug mode as you suggested. For example, right now, the application is freeze and all I can see on command line is "D/FlutterBluePlugin(15290): [onCharacteristicChanged] uuid: ***" since I am using Bluetooth connection. There is nothing else indicating me why this is occurring – display_name Jun 16 '22 at 10:34
  • If it really doesnt show any logs you can try identify the issue by removing code and dependencies one by one and try to limit the possible error sources – DEFL Jun 16 '22 at 11:29
  • If you share me a GitHub link I can also take a look – DEFL Jun 16 '22 at 11:30
  • @EnviroApps Thank you very much for your help. I am not allowed to share the code and it is a huge project. Thus, I prepared a codeshare.io that contains only the code that I am using on this particular page where the application crashes: https://codeshare.io/X8o6qn As you suggested me, I removed all the code I am not using but the result did not change. Sometimes the application screen freezes and I cannot even touch, or sometimes it just shuts down by itself. I also used logcat but there is nothing wrong there. Removing the cache and reinstalling didn't help either. – display_name Jun 16 '22 at 15:03
  • Also, I don't know if that helps but it is usually crashing in 23-24 minutes (that's why I am thinking it is probably not an incompatibility issue between packages, otherwise it would crash at the beginning (?).). I was first using a SSH connection so I thought this might be the issue, like the SSH is dropping off or something like that. So I stopped using it but the application is still crashing at the same moment. I also made sure that I don't have any loops except the Bluetooth connection. – display_name Jun 16 '22 at 15:07
  • Hello Sir, actually I didn't suggest removing the code you are not using more like testing each individual part to see what the source is. What is surprising is that the app freezes not because of user input but after after a specific amount of time. After 24 minutes is there anything special happening? Like App goes in background, something is executed, changes lifecycle and so on? – DEFL Jun 16 '22 at 15:15
  • It also happening on other devices right? – DEFL Jun 16 '22 at 15:16
  • I have checked the code but there are too many files missing to compile it. However if you dont find anything similar online and in the logs I would go with trying to test each class and see if the error still persists. Also using different devices and so on – DEFL Jun 16 '22 at 15:23
  • There is nothing special happening after 24 times. I'm just receiving and displaying on the screen. I thought maybe the memory was getting full after 24 times but I don't see any warnings about memory either. – display_name Jun 16 '22 at 15:27
  • The problem occurs on different devices as well. Thank you tho, I appreciate your help – display_name Jun 16 '22 at 15:28
  • Ok sorry but then I am out of ideas the only thing I would do in your situation is rebuilding piece by piece and see when it occurs however I can imagine there are more effective solutions. Good luck with it tho! – DEFL Jun 16 '22 at 16:38
  • Thank you! I will update if I can find a solution. – display_name Jun 16 '22 at 17:30

0 Answers0