I am trying to encode some kind of application using the Google Maps API. The map is shown in the main action.
On some phones, including the emulator, the application starts immediately after launch. The only phone he works with is my Galaxy S1, which launches CM10.1 (4.2.2).
Crash on my HTC DESIRE HD (4.2.2)
MainActivity.java:
import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.net.Uri; import android.os.Bundle; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; import android.widget.Toast; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.MapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; public class MainActivity extends Activity { public void ToastLoadShout(String msg){Toast.makeText(this, msg, Toast.LENGTH_LONG).show();} static final LatLng HAMBURG = new LatLng(53.558, 9.927); static final LatLng KIEL = new LatLng(53.551, 9.993); static final LatLng gps = new LatLng(0, 0); static double lat=0.0; static double lon=0.0; private GoogleMap map; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); turnGPSOn(); map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)) .getMap();
I have HTC logcat here:
08-01 18:46:29.929: I/Process(4007): Sending signal. PID: 4007 SIG: 9 08-01 18:46:32.031: D/skia(4024): new locale en-Latn-GB 08-01 18:46:32.141: W/GooglePlayServicesUtil(4024): Google Play services out of date. Requires 3159100 but found 2012110 08-01 18:46:32.151: W/GooglePlayServicesUtil(4024): Google Play services out of date. Requires 3159100 but found 2012110 08-01 18:46:32.151: W/GooglePlayServicesUtil(4024): Google Play services out of date. Requires 3159100 but found 2012110 08-01 18:46:32.161: W/GooglePlayServicesUtil(4024): Google Play services out of date. Requires 3159100 but found 2012110 08-01 18:46:32.171: W/GooglePlayServicesUtil(4024): Google Play services out of date. Requires 3159100 but found 2012110 08-01 18:46:32.231: W/GooglePlayServicesUtil(4024): Google Play services out of date. Requires 3159100 but found 2012110 08-01 18:46:32.231: D/AndroidRuntime(4024): Shutting down VM 08-01 18:46:32.231: W/dalvikvm(4024): threadid=1: thread exiting with uncaught exception (group=0x40b10930) 08-01 18:46:32.241: E/AndroidRuntime(4024): FATAL EXCEPTION: main 08-01 18:46:32.241: E/AndroidRuntime(4024): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.free/com.example.free.MainActivity}: java.lang.NullPointerException: IBitmapDescriptorFactory is not initialized 08-01 18:46:32.241: E/AndroidRuntime(4024): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308) 08-01 18:46:32.241: E/AndroidRuntime(4024): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358) 08-01 18:46:32.241: E/AndroidRuntime(4024): at android.app.ActivityThread.access$600(ActivityThread.java:153) 08-01 18:46:32.241: E/AndroidRuntime(4024): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247) 08-01 18:46:32.241: E/AndroidRuntime(4024): at android.os.Handler.dispatchMessage(Handler.java:99) 08-01 18:46:32.241: E/AndroidRuntime(4024): at android.os.Looper.loop(Looper.java:137) 08-01 18:46:32.241: E/AndroidRuntime(4024): at android.app.ActivityThread.main(ActivityThread.java:5227) 08-01 18:46:32.241: E/AndroidRuntime(4024): at java.lang.reflect.Method.invokeNative(Native Method) 08-01 18:46:32.241: E/AndroidRuntime(4024): at java.lang.reflect.Method.invoke(Method.java:511) 08-01 18:46:32.241: E/AndroidRuntime(4024): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795) 08-01 18:46:32.241: E/AndroidRuntime(4024): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562) 08-01 18:46:32.241: E/AndroidRuntime(4024): at dalvik.system.NativeStart.main(Native Method) 08-01 18:46:32.241: E/AndroidRuntime(4024): Caused by: java.lang.NullPointerException: IBitmapDescriptorFactory is not initialized 08-01 18:46:32.241: E/AndroidRuntime(4024): at com.google.android.gms.internal.xb(Unknown Source) 08-01 18:46:32.241: E/AndroidRuntime(4024): at com.google.android.gms.maps.model.BitmapDescriptorFactory.aX(Unknown Source) 08-01 18:46:32.241: E/AndroidRuntime(4024): at com.google.android.gms.maps.model.BitmapDescriptorFactory.fromResource(Unknown Source) 08-01 18:46:32.241: E/AndroidRuntime(4024): at com.example.free.MainActivity.onCreate(MainActivity.java:52) 08-01 18:46:32.241: E/AndroidRuntime(4024): at android.app.Activity.performCreate(Activity.java:5104) 08-01 18:46:32.241: E/AndroidRuntime(4024): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 08-01 18:46:32.241: E/AndroidRuntime(4024): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2262) 08-01 18:46:32.241: E/AndroidRuntime(4024): ... 11 more
And the logcat emulator:
08-01 15:27:48.565: E/Trace(981): error opening trace file: No such file or directory (2) 08-01 15:27:49.305: W/GooglePlayServicesUtil(981): Google Play services out of date. Requires 3159100 but found 1 08-01 15:27:49.326: W/GooglePlayServicesUtil(981): Google Play services out of date. Requires 3159100 but found 1 08-01 15:27:49.345: W/GooglePlayServicesUtil(981): Google Play services out of date. Requires 3159100 but found 1 08-01 15:27:49.366: W/GooglePlayServicesUtil(981): Google Play services out of date. Requires 3159100 but found 1 08-01 15:27:49.385: W/GooglePlayServicesUtil(981): Google Play services out of date. Requires 3159100 but found 1 08-01 15:27:49.565: D/dalvikvm(981): GC_CONCURRENT freed 200K, 4% free 8223K/8519K, paused 36ms+5ms, total 163ms 08-01 15:27:49.565: D/dalvikvm(981): WAIT_FOR_CONCURRENT_GC blocked 88ms 08-01 15:27:49.745: W/GooglePlayServicesUtil(981): Google Play services out of date. Requires 3159100 but found 1 08-01 15:27:49.745: D/AndroidRuntime(981): Shutting down VM 08-01 15:27:49.755: W/dalvikvm(981): threadid=1: thread exiting with uncaught exception (group=0x40a13300) 08-01 15:27:49.765: E/AndroidRuntime(981): FATAL EXCEPTION: main 08-01 15:27:49.765: E/AndroidRuntime(981): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.free/com.example.free.MainActivity}: java.lang.NullPointerException: IBitmapDescriptorFactory is not initialized 08-01 15:27:49.765: E/AndroidRuntime(981): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059) 08-01 15:27:49.765: E/AndroidRuntime(981): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 08-01 15:27:49.765: E/AndroidRuntime(981): at android.app.ActivityThread.access$600(ActivityThread.java:130) 08-01 15:27:49.765: E/AndroidRuntime(981): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 08-01 15:27:49.765: E/AndroidRuntime(981): at android.os.Handler.dispatchMessage(Handler.java:99) 08-01 15:27:49.765: E/AndroidRuntime(981): at android.os.Looper.loop(Looper.java:137) 08-01 15:27:49.765: E/AndroidRuntime(981): at android.app.ActivityThread.main(ActivityThread.java:4745) 08-01 15:27:49.765: E/AndroidRuntime(981): at java.lang.reflect.Method.invokeNative(Native Method) 08-01 15:27:49.765: E/AndroidRuntime(981): at java.lang.reflect.Method.invoke(Method.java:511) 08-01 15:27:49.765: E/AndroidRuntime(981): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 08-01 15:27:49.765: E/AndroidRuntime(981): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 08-01 15:27:49.765: E/AndroidRuntime(981): at dalvik.system.NativeStart.main(Native Method) 08-01 15:27:49.765: E/AndroidRuntime(981): Caused by: java.lang.NullPointerException: IBitmapDescriptorFactory is not initialized 08-01 15:27:49.765: E/AndroidRuntime(981): at com.google.android.gms.internal.xb(Unknown Source) 08-01 15:27:49.765: E/AndroidRuntime(981): at com.google.android.gms.maps.model.BitmapDescriptorFactory.aX(Unknown Source) 08-01 15:27:49.765: E/AndroidRuntime(981): at com.google.android.gms.maps.model.BitmapDescriptorFactory.fromResource(Unknown Source) 08-01 15:27:49.765: E/AndroidRuntime(981): at com.example.free.MainActivity.onCreate(MainActivity.java:52) 08-01 15:27:49.765: E/AndroidRuntime(981): at android.app.Activity.performCreate(Activity.java:5008) 08-01 15:27:49.765: E/AndroidRuntime(981): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 08-01 15:27:49.765: E/AndroidRuntime(981): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) 08-01 15:27:49.765: E/AndroidRuntime(981): ... 11 more 08-01 15:28:19.685: I/Process(981): Sending signal. PID: 981 SIG: 9 08-01 15:52:15.355: E/Trace(1058): error opening trace file: No such file or directory (2) 08-01 15:52:16.015: W/GooglePlayServicesUtil(1058): Google Play services out of date. Requires 3159100 but found 1 08-01 15:52:16.025: W/GooglePlayServicesUtil(1058): Google Play services out of date. Requires 3159100 but found 1 08-01 15:52:16.055: W/GooglePlayServicesUtil(1058): Google Play services out of date. Requires 3159100 but found 1 08-01 15:52:16.075: W/GooglePlayServicesUtil(1058): Google Play services out of date. Requires 3159100 but found 1 08-01 15:52:16.095: W/GooglePlayServicesUtil(1058): Google Play services out of date. Requires 3159100 but found 1 08-01 15:52:16.265: D/dalvikvm(1058): GC_CONCURRENT freed 206K, 4% free 8223K/8519K, paused 76ms+5ms, total 157ms 08-01 15:52:16.265: D/dalvikvm(1058): WAIT_FOR_CONCURRENT_GC blocked 31ms 08-01 15:52:16.326: W/GooglePlayServicesUtil(1058): Google Play services out of date. Requires 3159100 but found 1 08-01 15:52:16.335: D/AndroidRuntime(1058): Shutting down VM 08-01 15:52:16.335: W/dalvikvm(1058): threadid=1: thread exiting with uncaught exception (group=0x40a13300) 08-01 15:52:16.355: E/AndroidRuntime(1058): FATAL EXCEPTION: main 08-01 15:52:16.355: E/AndroidRuntime(1058): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.free/com.example.free.MainActivity}: java.lang.NullPointerException: IBitmapDescriptorFactory is not initialized 08-01 15:52:16.355: E/AndroidRuntime(1058): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059) 08-01 15:52:16.355: E/AndroidRuntime(1058): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 08-01 15:52:16.355: E/AndroidRuntime(1058): at android.app.ActivityThread.access$600(ActivityThread.java:130) 08-01 15:52:16.355: E/AndroidRuntime(1058): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 08-01 15:52:16.355: E/AndroidRuntime(1058): at android.os.Handler.dispatchMessage(Handler.java:99) 08-01 15:52:16.355: E/AndroidRuntime(1058): at android.os.Looper.loop(Looper.java:137) 08-01 15:52:16.355: E/AndroidRuntime(1058): at android.app.ActivityThread.main(ActivityThread.java:4745) 08-01 15:52:16.355: E/AndroidRuntime(1058): at java.lang.reflect.Method.invokeNative(Native Method) 08-01 15:52:16.355: E/AndroidRuntime(1058): at java.lang.reflect.Method.invoke(Method.java:511) 08-01 15:52:16.355: E/AndroidRuntime(1058): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 08-01 15:52:16.355: E/AndroidRuntime(1058): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 08-01 15:52:16.355: E/AndroidRuntime(1058): at dalvik.system.NativeStart.main(Native Method) 08-01 15:52:16.355: E/AndroidRuntime(1058): Caused by: java.lang.NullPointerException: IBitmapDescriptorFactory is not initialized 08-01 15:52:16.355: E/AndroidRuntime(1058): at com.google.android.gms.internal.xb(Unknown Source) 08-01 15:52:16.355: E/AndroidRuntime(1058): at com.google.android.gms.maps.model.BitmapDescriptorFactory.aX(Unknown Source) 08-01 15:52:16.355: E/AndroidRuntime(1058): at com.google.android.gms.maps.model.BitmapDescriptorFactory.fromResource(Unknown Source) 08-01 15:52:16.355: E/AndroidRuntime(1058): at com.example.free.MainActivity.onCreate(MainActivity.java:52) 08-01 15:52:16.355: E/AndroidRuntime(1058): at android.app.Activity.performCreate(Activity.java:5008) 08-01 15:52:16.355: E/AndroidRuntime(1058): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 08-01 15:52:16.355: E/AndroidRuntime(1058): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) 08-01 15:52:16.355: E/AndroidRuntime(1058): ... 11 more
source share