wongpiwat / trust-location

A Flutter plugin for detecting mock location on Android device. (Supports only high accuracy location mode)
https://pub.dev/packages/trust_location
BSD 3-Clause "New" or "Revised" License
15 stars 8 forks source link

Trust-location is causing ANR when used in the same project with the background_locator_2 library #19

Open tulioccalazans opened 1 year ago

tulioccalazans commented 1 year ago

Hi, your library is causing ANR in my project and it is possible that it causes the same problem in other libraries that use device location.

I/locator_exampl(19665): Thread[3,tid=19672,WaitingInMainSignalCatcherLoop,Thread*=0x7de5016400,peer=0x17ec0020,"Signal Catcher"]: reacting to signal 3
I/locator_exampl(19665): 
I/locator_exampl(19665): Wrote stack traces to '[tombstoned]'

So that you can test it, download my FORK from the background_locator_2 project and add your library in the pubspec.yaml file of the "example" project:

background_locator_2: path: ../

path_provider: ^2.0.8 location_permissions: ^3.0.0+1

trust_location: ^2.0.13

In the example project, when you press the "Start" button, you will notice that the app freezes.

PS: I noticed this problem when testing the safe-device library, which also uses your library. Upon investigation, I noticed that the problem is actually with your library.

Ltei commented 1 year ago

I have the safe issue (constant ANR when calling isMockLocation on Android). I use trust-location (safe-device) with geolocator

wahyu-handayani commented 1 year ago

I have the same case like @tulioccalazans. Have you found any solution ?

tulioccalazans commented 1 year ago

I have the same case like @tulioccalazans. Have you found any solution ?

Nothing yet. I stopped using Trust-location.

IonVillarreal commented 1 year ago

meanwhile in the archive pubspec.yaml

safe_device: git: url: https://github.com/tulioccalazans/safe_device

thanks @tulioccalazans ANR errors gone for now