Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

O app dá erro se o GPS não estiver habilitado #152

Open
manoelcampos opened this issue Jun 30, 2020 · 7 comments
Open

O app dá erro se o GPS não estiver habilitado #152

manoelcampos opened this issue Jun 30, 2020 · 7 comments
Assignees
Labels
bug Something isn't working mobile

Comments

@manoelcampos
Copy link
Contributor

manoelcampos commented Jun 30, 2020

Ocorre o erro "Location provider is unavailable. Make sure that location services are enabled". Ele funciona por um tempo, depois começa a dar esse erro. Lembro de ter ocorrido uma vez, mas é preciso testar o app pra ver se volta a ocorrer, desativando o GPS, o 4G e o WiFi, um de cada vez para ver como o app se comporta.
Tudo isso é usado para obter a localização, sendo o GPS o mais preciso, mas o que mais consome bateria.

No iPhone ocorreu

[Unhandled promise rejection: Error: Background Location has not been configured. To enable it, add `location` to `UIBackgroundModes` in Info.plist file.]

Stack trace:
  node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:99:50 in fn
  node_modules/@unimodules/react-native-adapter/build/NativeModulesProxy.js:15:46 in moduleName.methodInfo.name
  node_modules/expo-location/build/Location.js:331:49 in startLocationUpdatesAsync
  node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
  node_modules/regenerator-runtime/runtime.js:274:30 in invoke
  node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
  node_modules/regenerator-runtime/runtime.js:135:28 in invoke
  node_modules/regenerator-runtime/runtime.js:170:17 in PromiseImpl$argument_0
  node_modules/promise/setimmediate/core.js:45:7 in tryCallTwo
  node_modules/promise/setimmediate/core.js:200:23 in doResolve
  node_modules/promise/setimmediate/core.js:66:12 in Promise
  node_modules/regenerator-runtime/runtime.js:169:31 in PromiseImpl$argument_0
  node_modules/regenerator-runtime/runtime.js:192:38 in enqueue
  node_modules/regenerator-runtime/runtime.js:219:8 in exports.async
  node_modules/expo-location/build/Location.js:329:7 in startLocationUpdatesAsync
  utils/LocalizacaoDispositivo.js:14:38 in startLocationBackgroundUpdate
  node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
  node_modules/regenerator-runtime/runtime.js:274:30 in invoke
  node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
  node_modules/regenerator-runtime/runtime.js:135:28 in invoke
  node_modules/regenerator-runtime/runtime.js:145:19 in PromiseImpl.resolve.then$argument_0
  node_modules/promise/setimmediate/core.js:37:14 in tryCallOne
  node_modules/promise/setimmediate/core.js:123:25 in setImmediate$argument_0
  node_modules/react-native/Libraries/Core/Timers/JSTimers.js:146:14 in _callTimer
  node_modules/react-native/Libraries/Core/Timers/JSTimers.js:194:17 in _callImmediatesPass
  node_modules/react-native/Libraries/Core/Timers/JSTimers.js:458:30 in callImmediates
  [native code]:null in callImmediates
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:407:6 in __callImmediates
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:143:6 in __guard$argument_0
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:384:10 in __guard
  node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:142:17 in __guard$argument_0
  [native code]:null in flushedQueue
  [native code]:null in invokeCallbackAndReturnFlushedQueue
@manoelcampos manoelcampos added bug Something isn't working mobile labels Jun 30, 2020
@manoelcampos manoelcampos added this to the AglomerouApp 1.0.0 milestone Jul 7, 2020
@ragirfernando
Copy link
Contributor

@manoelcampos, Bom dia, instalei o apk, estou testando no meus celulares e no da minha esposa. Eu desabilitei a localização o aplicativo pediu para que eu ativar a localização novamente. Se eu não ativar a localização o app não da erro. Más estou testando ainda.

@manoelcampos
Copy link
Contributor Author

Não esquece de desativar WiFi e 4G também.

@ragirfernando
Copy link
Contributor

Sim, estou fazendo desse jeito.

@manoelcampos manoelcampos removed this from the AglomerouApp 1.0.0 milestone Jul 20, 2020
@manoelcampos
Copy link
Contributor Author

Ragir, como ficou a issue?
Você precisa descrever o que fez e fechá-la.

@ragirfernando
Copy link
Contributor

@manoelcampos, Boa noite, eu instalei o apk no dispositivo, quando eu desabilito a localização e abro o mapa o app não da erro apenas pede para abilitar a localização. Caso eu não abilite a localização o app continua funcionando. Agora no emulador o erro e reproduzido no console.log, más o app continua funcionando. Sobre o erro no iPhone não tem como eu emular no iPhone.

@manoelcampos
Copy link
Contributor Author

Então, se no emulador deu erro, é preciso mais testes. Envia o texto da msg de erro completa aqui

@ragirfernando
Copy link
Contributor

Está sendo exibido esse erro no console.

undefined is not an object (evaluating 'data.results[1].address_components')

  • utils/LocalizacaoDispositivo.js:94:32 in getGeocodingLocalizacao
  • node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
  • node_modules/regenerator-runtime/runtime.js:274:30 in invoke
  • node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
  • node_modules/regenerator-runtime/runtime.js:135:28 in invoke
  • node_modules/regenerator-runtime/runtime.js:145:19 in PromiseImpl.resolve.then$argument_0
  • node_modules/promise/setimmediate/core.js:37:14 in tryCallOne
  • node_modules/promise/setimmediate/core.js:123:25 in setImmediate$argument_0
  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:146:14 in _callTimer
  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:194:17 in _callImmediatesPass
  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:458:30 in callImmediates
  • [native code]:null in callImmediates
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:407:6 in __callImmediates
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:143:6 in __guard$argument_0
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:384:10 in __guard
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:142:17 in __guard$argument_0
  • [native code]:null in flushedQueue
  • [native code]:null in callFunctionReturnFlushedQueue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mobile
Projects
None yet
Development

No branches or pull requests

2 participants