Never mind found the error

Placement of the uses-library of Google Maps has to occur after the
ending activity tag..





On Aug 4, 9:56 am, "Fred Grott(shareme)" <[email protected]> wrote:
> Hello and Good Morning,
>
> I was doing examples of MapView to finish my templates for the
> AndCooper Build tool and found that no matter what example I try I get
> the same exception errors in SDK 1.5r3..
>
> First lets head off the obvious.
>
> -No widgets are present in the example.
> -Simple class:
>
> package com.mobilebytes.mymapview;
>
> import com.google.android.maps.MapActivity;
> import com.google.android.maps.MapController;
> import com.google.android.maps.MapView;
> import com.google.android.maps.MyLocationOverlay;
>
> import android.os.Bundle;
>
> public class MyMapViewActivity extends MapActivity {
>
>         private MapView mapView;
>         private MapController controller;
>
>     /** Called when the activity is first created. */
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>
>         setContentView(R.layout.main);
>         initMapView();
>         initMyLocation();
>
>     }
>
>     /** Find and initialize the map view. */
>     private void initMapView() {
>        mapView = (MapView) findViewById(R.id.mapview);
>        controller = mapView.getController();
>        mapView.setSatellite(true);
>        mapView.setBuiltInZoomControls(true);
>     }
>
>     /** Start tracking the position on the map. */
>     private void initMyLocation() {
>        final MyLocationOverlay overlay = new MyLocationOverlay(this,
> mapView);
>        overlay.enableMyLocation();
>        //overlay.enableCompass(); // does not work in emulator
>        overlay.runOnFirstFix(new Runnable() {
>           public void run() {
>              // Zoom in to current location
>              controller.setZoom(8);
>              controller.animateTo(overlay.getMyLocation());
>           }
>        });
>        mapView.getOverlays().add(overlay);
>     }
>
>         @Override
>         protected boolean isRouteDisplayed() {
>                 // TODO Auto-generated method stub
>                 return false;
>         }
>
> }
>
> AndroidManifest:
> <?xml version="1.0" encoding="utf-8"?>
> <manifest xmlns:android="http://schemas.android.com/apk/res/android";
>       package="com.mobilebytes.mymapview"
>       android:versionCode="1"
>       android:versionName="1.0">
>       <uses-permission
>          android:name="android.permission.ACCESS_COARSE_LOCATION" />
>    <uses-permission
>          android:name="android.permission.ACCESS_FINE_LOCATION" />
>    <uses-permission
>          android:name="android.permission.INTERNET" />
>     <application android:icon="@drawable/icon" android:label="@string/
> app_name">
>         <activity android:name=".MyMapViewActivity"
>                   android:label="@string/app_name">
>                   <uses-library
> android:name="com.google.android.maps" />
>             <intent-filter>
>                 <action android:name="android.intent.action.MAIN" />
>                 <category
> android:name="android.intent.category.LAUNCHER" />
>             </intent-filter>
>         </activity>
>     </application>
>     <uses-sdk android:minSdkVersion="3" />
>
> </manifest>
>
> Layout/main.xml:
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout
>    xmlns:android="http://schemas.android.com/apk/res/android";
>    android:id="@+id/frame"
>    android:orientation="vertical"
>    android:layout_width="fill_parent"
>    android:layout_height="fill_parent">
>
>     <com.google.android.maps.MapView
>         android:id="@+id/mapview"
>         android:layout_width="fill_parent"
>         android:layout_height="fill_parent"
>         android:clickable="true"
>         android:apiKey="0Y13mLRcN1pG-G_NF7p6XvcknFAqfmKQEJ-24sg"
>     />
>
> </LinearLayout>
>
> map.jar is on the classpath.
>
> Logcat output:
>
> 08-04 09:44:11.369: WARN/dalvikvm(935): Unable to resolve superclass
> of Lcom/mobilebytes/mymapview/MyMapViewActivity; (5)
> 08-04 09:44:11.389: WARN/dalvikvm(935): Link of class 'Lcom/
> mobilebytes/mymapview/MyMapViewActivity;' failed
> 08-04 09:44:11.399: DEBUG/AndroidRuntime(935): Shutting down VM
> 08-04 09:44:11.439: WARN/dalvikvm(935): threadid=3: thread exiting
> with uncaught exception (group=0x4000fe70)
> 08-04 09:44:11.439: ERROR/AndroidRuntime(935): Uncaught handler:
> thread main exiting due to uncaught exception
> 08-04 09:44:11.529: ERROR/AndroidRuntime(935):
> java.lang.RuntimeException: Unable to instantiate activity
> ComponentInfo{com.mobilebytes.mymapview/
> com.mobilebytes.mymapview.MyMapViewActivity}:
> java.lang.ClassNotFoundException:
> com.mobilebytes.mymapview.MyMapViewActivity in loader
> dalvik.system.pathclassloa...@435980f0
> 08-04 09:44:11.529: ERROR/AndroidRuntime(935):     at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2194)
> 08-04 09:44:11.529: ERROR/AndroidRuntime(935):     at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2284)
> 08-04 09:44:11.529: ERROR/AndroidRuntime(935):     at
> android.app.ActivityThread.access$1800(ActivityThread.java:112)
>
> Past reports of problems were with widgets and now it has happen to me
> with no widgets..
> Anybody else see the same problems?
>
> PS Example used was Ed's form his ProgmaticBookshelf Android book..
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to