>
Ao executar o projeto diretamente no meu celular android 2.3.6, quando clico no salvar ele dá um erro e encerra a aplicação. Comento as linhas onde são captadas a latitude e a longitude e a aplicação funciona corretamente. O GPD e o Wi-Fi estão todos habilitados e funcionando, mas não funciona a captação das coordenadas. Será que é por causa da versão do Android do meu celular que não está funcionando? Sem mais obrigado.
Ola Luciano...
vc deu todas as permissoes no androidmanifest.xml??
Sim, todas as permissões foram dadas. Mas procurando melhor no fórum, localizei o seguinte link: http://rlsystem.com.br/forum/android/505-erro-no-mapa-ao-listar-venda#top nele provavelmente estará a solução. Se der certo ou não posto aqui. Agradeço a sua atenção.
Então, fiz de acordo com a aula 10 e não funcionou:
logcat
06-12 11:17:10.514: D/dalvikvm(26678): DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp
06-12 11:17:10.514: W/dalvikvm(26678): VFY: unable to resolve instance field 39
06-12 11:17:10.514: D/dalvikvm(26678): VFY: replacing opcode 0x52 at 0x0012
06-12 11:17:10.514: D/dalvikvm(26678): VFY: dead code 0x0014-0018 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b (Landroid/content/res/Resources;)Z
06-12 11:17:10.522: W/dalvikvm(26678): VFY: unable to resolve virtual method 23: Landroid/app/Activity;.getFragmentManager ()Landroid/app/FragmentManager;
06-12 11:17:10.522: D/dalvikvm(26678): VFY: replacing opcode 0x6e at 0x0023
06-12 11:17:10.522: D/dalvikvm(26678): VFY: dead code 0x0026-0030 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.showErrorDialogFragment (ILandroid/app/Activity;ILandroid/content/DialogInterface$OnCancelListener;)Z
06-12 11:17:10.545: W/GooglePlayServicesUtil(26678): Google Play services out of date. Requires 4452000 but found 4325010
06-12 11:17:10.545: W/GooglePlayServicesUtil(26678): Google Play services out of date. Requires 4452000 but found 4325010
06-12 11:17:10.553: W/GooglePlayServicesUtil(26678): Google Play services out of date. Requires 4452000 but found 4325010
06-12 11:17:10.561: W/GooglePlayServicesUtil(26678): Google Play services out of date. Requires 4452000 but found 4325010
06-12 11:17:10.568: W/GooglePlayServicesUtil(26678): Google Play services out of date. Requires 4452000 but found 4325010
06-12 11:17:10.592: W/GooglePlayServicesUtil(26678): Google Play services out of date. Requires 4452000 but found 4325010
06-12 11:17:10.600: W/GooglePlayServicesUtil(26678): Google Play services out of date. Requires 4452000 but found 4325010
06-12 11:17:10.607: W/GooglePlayServicesUtil(26678): Google Play services out of date. Requires 4452000 but found 4325010
06-12 11:17:10.615: W/GooglePlayServicesUtil(26678): Google Play services out of date. Requires 4452000 but found 4325010
06-12 11:17:10.654: D/dalvikvm(26678): GC_CONCURRENT freed 243K, 47% free 3021K/5639K, external 666K/1056K, paused 4ms 4ms
06-12 11:17:10.654: W/GooglePlayServicesUtil(26678): Google Play services out of date. Requires 4452000 but found 4325010
06-12 11:17:10.662: W/GooglePlayServicesUtil(26678): Google Play services out of date. Requires 4452000 but found 4325010
06-12 11:17:10.662: D/AndroidRuntime(26678): Shutting down VM
06-12 11:17:10.662: W/dalvikvm(26678): threadid=1: thread exiting with uncaught exception (group=0x40018578)
06-12 11:17:10.670: E/AndroidRuntime(26678): FATAL EXCEPTION: main
06-12 11:17:10.670: E/AndroidRuntime(26678): java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.horussoft.vendas/br.com.horussoft.vendas.MapShowActivity}: java.lang.NullPointerException
06-12 11:17:10.670: E/AndroidRuntime(26678): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
06-12 11:17:10.670: E/AndroidRuntime(26678): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
06-12 11:17:10.670: E/AndroidRuntime(26678): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-12 11:17:10.670: E/AndroidRuntime(26678): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
06-12 11:17:10.670: E/AndroidRuntime(26678): at android.os.Handler.dispatchMessage(Handler.java:99)
06-12 11:17:10.670: E/AndroidRuntime(26678): at android.os.Looper.loop(Looper.java:130)
06-12 11:17:10.670: E/AndroidRuntime(26678): at android.app.ActivityThread.main(ActivityThread.java:3687)
06-12 11:17:10.670: E/AndroidRuntime(26678): at java.lang.reflect.Method.invokeNative(Native Method)
06-12 11:17:10.670: E/AndroidRuntime(26678): at java.lang.reflect.Method.invoke(Method.java:507)
06-12 11:17:10.670: E/AndroidRuntime(26678): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
06-12 11:17:10.670: E/AndroidRuntime(26678): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
06-12 11:17:10.670: E/AndroidRuntime(26678): at dalvik.system.NativeStart.main(Native Method)
06-12 11:17:10.670: E/AndroidRuntime(26678): Caused by: java.lang.NullPointerException
06-12 11:17:10.670: E/AndroidRuntime(26678): at br.com.horussoft.vendas.MapShowActivity.onCreate(MapShowActivity.java:31)
06-12 11:17:10.670: E/AndroidRuntime(26678): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-12 11:17:10.670: E/AndroidRuntime(26678): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
06-12 11:17:10.670: E/AndroidRuntime(26678): ... 11 more
já não sei mais o que eu faço, dá erro e aplicação fecha.
Consegui resolver o problema atualizando a API.