[Solved] Map And NullPointerException

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

[Solved] Map And NullPointerException

Postby problem » Mon Dec 31, 2007 6:16 pm

Anyone else having a problem where the newest version of the emulator is throwing a nullpointerexception when trying to display a map view. It worked great in an early version of the emulator now it throws an error.

Example code:

KudoMap.java
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. /**
  3.  
  4.  * KudoStar Map Activity
  5.  
  6.  */
  7.  
  8. package com.kudostar.android.kudostar;
  9.  
  10.  
  11.  
  12. import android.os.Bundle;
  13.  
  14.  
  15.  
  16. import com.google.android.maps.MapActivity;
  17.  
  18.  
  19.  
  20. /**
  21.  
  22.  * @author mike
  23.  
  24.  *
  25.  
  26.  */
  27.  
  28. public class KudoMap extends MapActivity {
  29.  
  30.     @Override
  31.  
  32.     protected void onCreate(Bundle icicle) {
  33.  
  34.             // TODO Auto-generated method stub
  35.  
  36.             super.onCreate( icicle );
  37.  
  38.             setContentView( R.layout.view_map );
  39.  
  40.     }
  41.  
  42. }
  43.  
  44.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


view_map.xml
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
  4.  
  5.     <view id="@+id/kudomap" class="com.google.android.maps.MapView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" />
  6.  
  7. </LinearLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
problem
Freshman
Freshman
 
Posts: 6
Joined: Mon Dec 31, 2007 6:07 pm
Location: Mesa, AZ

Top

Postby problem » Wed Jan 02, 2008 4:37 pm

Fixed.

Remove "userdata.img" and "emulator.cfg" from:

Windows:
C:\Documents and Settings\ [YOUR_USER] \Local configuration\Application Data\Android

OSX:
/Users/ [YOUR_USER] /.android
problem
Freshman
Freshman
 
Posts: 6
Joined: Mon Dec 31, 2007 6:07 pm
Location: Mesa, AZ

Postby plusminus » Thu Jan 03, 2008 2:01 pm

Hello 'problem',

yes, after updating the Emulator, there are often problems. Deleting the userdata.img-File is the easiest way.
Another solution is to run the emulator once with the "-wipe-data" parameter.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby bavarol » Mon Mar 17, 2008 8:38 pm

Hi, I have done what you said but other userdata.img and emulator.cfg is created.
I have written once at command line "-wipe-data" but it doesn't work.

My SDK Version is M3rc22.

Regards
bavarol
Experienced Developer
Experienced Developer
 
Posts: 52
Joined: Mon Dec 10, 2007 9:19 pm

Postby erbedo » Tue Mar 18, 2008 9:38 am

You can upgrade the sdk, and then you have to run emulator -wipe-data, not only the last part of the command :)
Proudly supporting Android :)
erbedo
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu Mar 13, 2008 9:39 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 3 guests