Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle map application program crashes at the launch
    primarykey
    data
    text
    <p>I have been trying to add a map to my application, I have followed instructions on the android developers HelloGoogleMaps tutorial but my map is just force closing when I run the maps option. I have obtained my api key logged permissions in manifest</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.MappDemo.mymaps" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="7" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:debuggable="true" &gt; &lt;activity android:name=".MappingDemoActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".ShowTheMap" android:label="Lat/Long Location"&gt; &lt;/activity&gt; &lt;activity android:name=".MapMe" android:label="Track Present Location"&gt; &lt;/activity&gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>Can some one tell if any thing needs to be configured in addition to run the code?</p> <pre><code>03-25 11:50:52.217: I/Process(687): Sending signal. PID: 687 SIG: 9 03-25 11:51:00.557: D/AndroidRuntime(729): Shutting down VM 03-25 11:51:00.567: W/dalvikvm(729): threadid=1: thread exiting with uncaught exception (group=0x40015560) 03-25 11:51:00.627: E/AndroidRuntime(729): FATAL EXCEPTION: main 03-25 11:51:00.627: E/AndroidRuntime(729): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.MappDemo.mymaps/com.MappDemo.mymaps.MappingDemoActivity}: java.lang.ClassCastException: com.MappDemo.mymaps.MappingDemoActivity 03-25 11:51:00.627: E/AndroidRuntime(729): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 03-25 11:51:00.627: E/AndroidRuntime(729): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 03-25 11:51:00.627: E/AndroidRuntime(729): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 03-25 11:51:00.627: E/AndroidRuntime(729): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 03-25 11:51:00.627: E/AndroidRuntime(729): at android.os.Handler.dispatchMessage(Handler.java:99) 03-25 11:51:00.627: E/AndroidRuntime(729): at android.os.Looper.loop(Looper.java:123) 03-25 11:51:00.627: E/AndroidRuntime(729): at android.app.ActivityThread.main(ActivityThread.java:3683) 03-25 11:51:00.627: E/AndroidRuntime(729): at java.lang.reflect.Method.invokeNative(Native Method) 03-25 11:51:00.627: E/AndroidRuntime(729): at java.lang.reflect.Method.invoke(Method.java:507) 03-25 11:51:00.627: E/AndroidRuntime(729): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 03-25 11:51:00.627: E/AndroidRuntime(729): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 03-25 11:51:00.627: E/AndroidRuntime(729): at dalvik.system.NativeStart.main(Native Method) 03-25 11:51:00.627: E/AndroidRuntime(729): Caused by: java.lang.ClassCastException: com.MappDemo.mymaps.MappingDemoActivity 03-25 11:51:00.627: E/AndroidRuntime(729): at com.MappDemo.mymaps.MappingDemoActivity.onCreate(MappingDemoActivity.java:19) 03-25 11:51:00.627: E/AndroidRuntime(729): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 03-25 11:51:00.627: E/AndroidRuntime(729): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 03-25 11:51:00.627: E/AndroidRuntime(729): ... 11 more 03-25 11:51:10.013: I/Process(729): Sending signal. PID: 729 SIG: 9 03-25 11:52:16.817: D/AndroidRuntime(782): Shutting down VM 03-25 11:52:16.817: W/dalvikvm(782): threadid=1: thread exiting with uncaught exception (group=0x40015560) 03-25 11:52:16.877: E/AndroidRuntime(782): FATAL EXCEPTION: main 03-25 11:52:16.877: E/AndroidRuntime(782): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.MappDemo.mymaps/com.MappDemo.mymaps.MappingDemoActivity}: java.lang.ClassCastException: com.MappDemo.mymaps.MappingDemoActivity 03-25 11:52:16.877: E/AndroidRuntime(782): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 03-25 11:52:16.877: E/AndroidRuntime(782): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 03-25 11:52:16.877: E/AndroidRuntime(782): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 03-25 11:52:16.877: E/AndroidRuntime(782): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 03-25 11:52:16.877: E/AndroidRuntime(782): at android.os.Handler.dispatchMessage(Handler.java:99) 03-25 11:52:16.877: E/AndroidRuntime(782): at android.os.Looper.loop(Looper.java:123) 03-25 11:52:16.877: E/AndroidRuntime(782): at android.app.ActivityThread.main(ActivityThread.java:3683) 03-25 11:52:16.877: E/AndroidRuntime(782): at java.lang.reflect.Method.invokeNative(Native Method) 03-25 11:52:16.877: E/AndroidRuntime(782): at java.lang.reflect.Method.invoke(Method.java:507) 03-25 11:52:16.877: E/AndroidRuntime(782): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 03-25 11:52:16.877: E/AndroidRuntime(782): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 03-25 11:52:16.877: E/AndroidRuntime(782): at dalvik.system.NativeStart.main(Native Method) 03-25 11:52:16.877: E/AndroidRuntime(782): Caused by: java.lang.ClassCastException: com.MappDemo.mymaps.MappingDemoActivity 03-25 11:52:16.877: E/AndroidRuntime(782): at com.MappDemo.mymaps.MappingDemoActivity.onCreate(MappingDemoActivity.java:19) 03-25 11:52:16.877: E/AndroidRuntime(782): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 03-25 11:52:16.877: E/AndroidRuntime(782): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 03-25 11:52:16.877: E/AndroidRuntime(782): ... 11 more </code></pre> <p>this is what I can see in logcat.. this what I have in mappingDemoActivity.java</p> <pre><code>public class MappingDemoActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //add listners for all buttons View firstbutton= findViewById(R.id.geocode_button); firstbutton.setOnClickListener((OnClickListener) this); View secondButton = findViewById(R.id.latlong_button); secondButton.setOnClickListener((OnClickListener) this); View thirdButton = findViewById(R.id.presentLocation_button); thirdButton.setOnClickListener((OnClickListener) this); } public void onClick(View v) { switch(v.getId()) { case R.id.geocode_button: Log.i("Button","Button 1 pushed"); Intent j = new Intent(this, ShowTheMap.class); startActivity(j); break; case R.id.latlong_button: Log.i("Button","Button 2 pushed"); Intent k = new Intent(this, ShowTheMap.class); startActivity(k); break; case R.id.presentLocation_button: Log.i("Button","Button 3 pushed"); Intent m = new Intent(this, MapMe.class); startActivity(m); break; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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