yayaa / LocationManager

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

Always get a timeout error message #11

Closed lvs-coding closed 8 years ago

lvs-coding commented 8 years ago

I always get an error "Couldn't get location, and timeout!" when trying to get the location. I'm new to Android dev.

@Override public LocationConfiguration getLocationConfiguration() { return new LocationConfiguration() .keepTracking(true) .askForGooglePlayServices(true) .setWaitPeriod(ProviderType.GOOGLE_PLAY_SERVICES, 5 * 1000) .setWaitPeriod(ProviderType.GPS, 10 * 10000) .setGPSMessage("Would you mind to turn GPS on?") .setRationalMessage("Gimme the permission!"); }

09-13 15:58:22.072 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/GPServicesLocationProvider: GoogleApiClient is connected. 09-13 15:58:22.082 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/GPServicesLocationProvider: Ask for location update... 09-13 15:58:22.082 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/GPServicesLocationProvider: Asking for SettingsApi... 09-13 15:58:22.165 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/GPServicesLocationProvider: We got GPS, Wifi and/or Cell network providers enabled enough to receive location as we needed. Requesting location update... 09-13 15:59:11.399 16435-16441/com.lvsandroid.cprojectslvstrainingandroidlocationmanager W/art: Suspending all threads took: 7.510ms 09-13 15:59:11.722 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/LocationManager$2: We couldn't receive location from GooglePlayServices, so switching default providers... 09-13 15:59:11.722 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/GPServicesLocationProvider: Canceling GPServiceLocationProvider... 09-13 15:59:11.728 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/LocationManager: Attempting to get location from default providers... 09-13 15:59:11.745 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/LocationManager: We got permission, getting location... 09-13 15:59:11.772 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/DefaultLocationProvider: GPS is already enabled, getting location... 09-13 15:59:11.777 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/DefaultLocationProvider: LastKnowLocation is not usable. 09-13 15:59:11.777 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/DefaultLocationProvider: Ask for location update... 09-13 16:00:51.793 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/DefaultLocationProvider$4: We waited enough for GPS, switching to Network provider... 09-13 16:00:51.799 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/DefaultLocationProvider: Network is enabled, getting location... 09-13 16:00:51.800 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/DefaultLocationProvider: LastKnowLocation is not usable. 09-13 16:00:51.805 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/DefaultLocationProvider: Ask for location update... 09-13 16:01:11.828 16435-16435/com.lvsandroid.cprojectslvstrainingandroidlocationmanager I/DefaultLocationProvider$4: Network Provider is not provide location in required period, calling fail... 09-13 16:01:11.845 16435-16478/com.lvsandroid.cprojectslvstrainingandroidlocationmanager E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb2ef4880

lvs-coding commented 8 years ago

Ok...Sorry for that, i'm new to Github too. I just realized we can see the closed issues, this question already answered there. It works perfectly on a real device so it's more an emulator issue... Thank you, great lib.