Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid maps view crashes app
    text
    copied!<p>I've just started to learn development for the android.</p> <p>I set up a test app with a basic textview that when you clicked on it, changed text. that worked fine. So I decided I wanted to do something interesting with google maps using mapview.</p> <p>I've followed the instructions in the documentation, and looked around at the demomaps demo app, but when I launch my app in a AVD (pointed to the correct source, google APIs lvl3) I get "the application has stopped unexpectedly. please try again", when I launch in debug mode, the only error I get is "source not found" </p> <p>Here are some excerpts from my code:</p> <p>views</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;com.google.android.maps.MapView android:layout_width="fill_parent" android:layout_height="fill_parent" android:enabled="true" android:clickable="true" android:apiKey="[ommitted for safety - i have an apikey though]" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>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="leblanc.test.HelloCora" android:versionCode="1" android:versionName="1.0"&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".hello" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;uses-sdk android:minSdkVersion="3" /&gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;/manifest&gt; </code></pre> <p>my source .java is basically default</p> <p>I am developing in eclipse using the ADT, on a linux machine</p> <p>let me know if there is any other info you need</p> <p>Thanks!</p> <p><b> EDIT: </b> More information on the error I am getting.</p> <pre><code>TestApp [Android Application] DalvikVM [localhost:8619] Thread [ &lt;3&gt; Main ] (Suspended (exception RuntimeException)) ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord) line: 2268 ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord) line: 2284 ActivityThread.access$1800(ActivityThread, ActivityThread$ActivityRecord) line: 112 ActivityThread$H.handleMessage(Message) line: 1692 ActivityThread$H(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 123 ActivityThread.main(String[]) line: 3948 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method] Method.invoke(Object, Object...) line: 521 ZygoteInit$MethodAndArgsCaller.run() line: 782 ZygoteInit.main(String[]) line: 540 NativeStart.main(String[]) line: not available [native method] </code></pre> <p>Also, the interesting thing is that the demomaps demo application in the android SDK does not crash (though the map data never loads, even though it has internet access permission)</p>
 

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