Note that there are some explanatory texts on larger screens.

plurals
  1. POApplication cannot be installed in the device / emulator
    text
    copied!<p>I am developing a map based app for android and in the final stage of detecting the current location. But now my app is not working. It can't be installed either in emulator or in the real device. Whenever I am trying, I am getting a message in the console which says:</p> <p>Application (map.apk) cannot be installed.</p> <p>This is my logcat:</p> <pre><code>01-14 18:08:20.576: D/dalvikvm(342): GC_FOR_MALLOC freed 4859 objects / 301296 bytes in 100ms 01-14 18:08:20.916: D/dalvikvm(342): GC_FOR_MALLOC freed 10156 objects / 616976 bytes in 96ms 01-14 18:08:21.216: D/dalvikvm(342): GC_FOR_MALLOC freed 4664 objects / 306384 bytes in 88ms 01-14 18:08:21.576: D/dalvikvm(342): GC_FOR_MALLOC freed 6137 objects / 374304 bytes in 152ms 01-14 18:08:21.956: D/dalvikvm(342): GC_FOR_MALLOC freed 8481 objects / 648904 bytes in 98ms 01-14 18:08:22.266: D/dalvikvm(342): GC_FOR_MALLOC freed 6080 objects / 370008 bytes in 98ms 01-14 18:08:22.407: D/AndroidRuntime(342): Shutting down VM 01-14 18:08:22.407: W/dalvikvm(342): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 01-14 18:08:22.427: E/AndroidRuntime(342): FATAL EXCEPTION: main 01-14 18:08:22.427: E/AndroidRuntime(342): java.lang.RuntimeException: Unable to start activity ComponentInfo{g.g.g/g.g.g.GPSLocatorActivity}: java.lang.NullPointerException 01-14 18:08:22.427: E/AndroidRuntime(342): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 01-14 18:08:22.427: E/AndroidRuntime(342): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 01-14 18:08:22.427: E/AndroidRuntime(342): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 01-14 18:08:22.427: E/AndroidRuntime(342): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 01-14 18:08:22.427: E/AndroidRuntime(342): at android.os.Handler.dispatchMessage(Handler.java:99) 01-14 18:08:22.427: E/AndroidRuntime(342): at android.os.Looper.loop(Looper.java:123) 01-14 18:08:22.427: E/AndroidRuntime(342): at android.app.ActivityThread.main(ActivityThread.java:4627) 01-14 18:08:22.427: E/AndroidRuntime(342): at java.lang.reflect.Method.invokeNative(Native Method) 01-14 18:08:22.427: E/AndroidRuntime(342): at java.lang.reflect.Method.invoke(Method.java:521) 01-14 18:08:22.427: E/AndroidRuntime(342): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 01-14 18:08:22.427: E/AndroidRuntime(342): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 01-14 18:08:22.427: E/AndroidRuntime(342): at dalvik.system.NativeStart.main(Native Method) 01-14 18:08:22.427: E/AndroidRuntime(342): Caused by: java.lang.NullPointerException 01-14 18:08:22.427: E/AndroidRuntime(342): at g.g.g.GPSLocatorActivity.onCreate(GPSLocatorActivity.java:50) 01-14 18:08:22.427: E/AndroidRuntime(342): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 01-14 18:08:22.427: E/AndroidRuntime(342): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 01-14 18:08:22.427: E/AndroidRuntime(342): ... 11 more </code></pre> <p>This is my code:</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.mapView); mapView.setTraffic(true); mapView.setBuiltInZoomControls(true); List&lt;Overlay&gt; mapOverlays = mapView.getOverlays(); Drawable drawable = this.getResources().getDrawable(R.drawable.icon); HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable,this); GeoPoint point = new GeoPoint( (int) (location.getLatitude() * 1E6), (int) (location.getLongitude() * 1E6)); OverlayItem overlayitem = new OverlayItem(point,"","" ); itemizedoverlay.addOverlay(overlayitem); mapOverlays.add(itemizedoverlay); } @Override protected boolean isRouteDisplayed() { return false; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload