ufukhawk / safe_device

MIT License
46 stars 52 forks source link

not respond when the app is started #53

Open phanil opened 2 months ago

phanil commented 2 months ago

When used with geolocator, the UI will not respond when the app is started.

rpekarek-tc commented 2 months ago

I think we may be experiencing this issue as well. It doesn't happen on iOS, but causes issues for a select few android devices. It is consistently happening for the Pixel6a, Pixel 7 and Pixel 9 running Android version 14

sadaqatdev commented 2 months ago

This issue occur on Techno Devices

sadaqatdev commented 2 months ago

Use less Until run on all devices

bagus-repository commented 2 months ago

same issue

sadaqatdev commented 2 months ago

When it to be fix ?

MelissaMashiro commented 2 months ago

This is happening to me as well ... Please solve this compatibility issue

ufukhawk commented 2 months ago

@phanil can you give more details?

MelissaMashiro commented 2 months ago

@ufukhawk When using safe_device package along with geolocator package. The App installs correctly, but at the moment of building the UI, it gets stuck and then the console shows this message: " The application may be doing too much work on its main thread." After that, the app die. This doesnt happen on IOS devices.

ufukhawk commented 2 months ago

hmm, i will check this.

MelissaMashiro commented 2 months ago

Thanks, let me know if you need more evidence

daffigusti commented 2 months ago

same issue here.

ufukhawk commented 2 months ago

How did you understand that the problem was with the safe_device ? Can I get an error message?

ufukhawk commented 2 months ago

try again : safe_device: ^1.1.9

MelissaMashiro commented 2 months ago

I just tried 1.1.9 version. The app starts well the first time you install it. But once you have it installed and run again, is when the delay happens..

These are the logs

D/FlutterGeolocator( 5896): Attaching Geolocator to activity
D/FlutterGeolocator( 5896): Creating service.
D/FlutterGeolocator( 5896): Binding to location service.
D/FlutterGeolocator( 5896): Geolocator foreground service connected
D/FlutterGeolocator( 5896): Initializing Geolocator services
D/FlutterGeolocator( 5896): Flutter engine connected. Connected engine count 1
I/FLTFireBGExecutor( 5896): Creating background FlutterEngine instance, with args: [--start-paused, --enable-dart-profiling]
D/FLTFireContextHolder( 5896): received application context.
D/FlutterGeolocator( 5896): Geolocator foreground service connected
D/FlutterGeolocator( 5896): Initializing Geolocator services
D/FlutterGeolocator( 5896): Flutter engine connected. Connected engine count 2
I/Choreographer( 5896): Skipped 1799 frames!  The application may be doing too much work on its main thread.

Is not that the app doesnt start, but it takes literally like 1 minute to fully render the First screen. And I get the message to "wait" or "close app" on the screen.

I know this problem is caused by safe_device and geolocator packages, because when I replace safe_device for another jailbreaker detection package, it works perfectly.

I still wanted to use this package (safe_device) because is definitely more precise than the others that i found

douglasfaria10 commented 1 month ago

I just tried 1.1.9 version. The app starts well the first time you install it. But once you have it installed and run again, is when the delay happens..

These are the logs

D/FlutterGeolocator( 5896): Attaching Geolocator to activity
D/FlutterGeolocator( 5896): Creating service.
D/FlutterGeolocator( 5896): Binding to location service.
D/FlutterGeolocator( 5896): Geolocator foreground service connected
D/FlutterGeolocator( 5896): Initializing Geolocator services
D/FlutterGeolocator( 5896): Flutter engine connected. Connected engine count 1
I/FLTFireBGExecutor( 5896): Creating background FlutterEngine instance, with args: [--start-paused, --enable-dart-profiling]
D/FLTFireContextHolder( 5896): received application context.
D/FlutterGeolocator( 5896): Geolocator foreground service connected
D/FlutterGeolocator( 5896): Initializing Geolocator services
D/FlutterGeolocator( 5896): Flutter engine connected. Connected engine count 2
I/Choreographer( 5896): Skipped 1799 frames!  The application may be doing too much work on its main thread.

Is not that the app doesnt start, but it takes literally like 1 minute to fully render the First screen. And I get the message to "wait" or "close app" on the screen.

I know this problem is caused by safe_device and geolocator packages, because when I replace safe_device for another jailbreaker detection package, it works perfectly.

I still wanted to use this package (safe_device) because is definitely more precise than the others that i found

Same issue here.

YaseenSaif commented 1 month ago

Any update

mahesh87ta commented 1 month ago

same issue, if we disable to location permission, the issue is not re producible and working smoothly. Any help on it?

bharathiselvan commented 1 month ago

I also face this issue. Any suggestions for resolving it?

masgari0007 commented 1 month ago

I think the issue has to do with this bit of code inside the MockLocation.LocationAssistant.acquireLocation lines 456-466. I'm not even doing checks against location (just doing emulator checks) yet this code still runs on start up. Downgrading to 1.1.4 before this class is introduced fixes the issue though you will lose the other upgrades.

        if (!updatesRequested) {
            requestLocationUpdates();
            // Check back in a few
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    acquireLocation();
                }
            }, 10000);
            return;
        }
ammarayoubi commented 3 weeks ago

I solved my problem using the following code: final bool isMockLocation = (await Geolocator.getCurrentPosition()).isMocked;

douglasfaria10 commented 3 weeks ago

In my case, remove safe_device works.

corepuncher commented 5 days ago

I am also getting this:

I/Choreographer( 8160): Skipped 718 frames! The application may be doing too much work on its main thread.