yayaa / LocationManager

Simplify getting user's location for Android
807 stars 187 forks source link

Couldn't get location, and timeout! #96

Closed cepero91 closed 5 years ago

cepero91 commented 5 years ago

Hello devs, this is my Configuration, i put this on a class extends LocationBaseActivity

new LocationConfiguration.Builder() .useDefaultProviders(new DefaultProviderConfiguration.Builder() .acceptableAccuracy(10.0f) .requiredDistanceInterval(5) .requiredTimeInterval(5 60 1000) // 5 minutes .acceptableTimePeriod(5 60 1000) // 5 minutes .setWaitPeriod(ProviderType.GPS, 20 1000) // 20 seconds .setWaitPeriod(ProviderType.NETWORK, 20 1000) // 20 seconds .gpsMessage("Turn GPS on?") .build()) .keepTracking(true) .build();

the problem is that always stop the request and show this message "Couldn't get location, and timeout!". I want to keep tracking the location, the permission is fine and gps is active but always get the same message. There i missing something?. Thanks very much.

Note: on emulator this behavior dont happens

LOGS

07-22 15:07:01.335 18371-18371/com.infinitum.bookingqba I/DefaultLocationProvider: We waited enough for GPS, switching to Network provider... 07-22 15:07:01.337 18371-18371/com.infinitum.bookingqba I/DefaultLocationProvider: Network is enabled, getting location... 07-22 15:07:01.349 18371-18371/com.infinitum.bookingqba I/DefaultLocationProvider: LastKnowLocation is not usable. 07-22 15:07:01.350 18371-18371/com.infinitum.bookingqba I/DefaultLocationProvider: Ask for location update... 07-22 15:07:21.382 18371-18371/com.infinitum.bookingqba I/DefaultLocationProvider: Network Provider is not provide location in required period, calling fail...

yayaa commented 5 years ago

From the configurations and logs, it doesn't look like you are doing alright - it might be device related, or where you launch your application. Can you try with different device or somewhere else?