java - error- dalvik.system.PathClassLoader [data/app/com.my.appname-2.apk] -


i searched lot similar kind of error, not getting solution it. getting error start app

03-21 10:33:08.100: e/androidruntime(13098): fatal exception: main 03-21 10:33:08.100: e/androidruntime(13098): java.lang.runtimeexception: unable instantiate activity componentinfo{com.example.airlife/com.example.airlife.mainactivity}: java.lang.classnotfoundexception: com.example.airlife.mainactivity in loader dalvik.system.pathclassloader[/data/app/com.example.airlife-2.apk] 03-21 10:33:08.100: e/androidruntime(13098):    @ android.app.activitythread.performlaunchactivity(activitythread.java:1785) 03-21 10:33:08.100: e/androidruntime(13098):    @ android.app.activitythread.handlelaunchactivity(activitythread.java:1893) 03-21 10:33:08.100: e/androidruntime(13098):    @ android.app.activitythread.access$1500(activitythread.java:135) 03-21 10:33:08.100: e/androidruntime(13098):    @ android.app.activitythread$h.handlemessage(activitythread.java:1054) 03-21 10:33:08.100: e/androidruntime(13098):    @ android.os.handler.dispatchmessage(handler.java:99) 03-21 10:33:08.100: e/androidruntime(13098):    @ android.os.looper.loop(looper.java:150) 03-21 10:33:08.100: e/androidruntime(13098):    @ android.app.activitythread.main(activitythread.java:4389) 03-21 10:33:08.100: e/androidruntime(13098):    @ java.lang.reflect.method.invokenative(native method) 03-21 10:33:08.100: e/androidruntime(13098):    @ java.lang.reflect.method.invoke(method.java:507) 03-21 10:33:08.100: e/androidruntime(13098):    @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:849) 03-21 10:33:08.100: e/androidruntime(13098):    @ com.android.internal.os.zygoteinit.main(zygoteinit.java:607) 03-21 10:33:08.100: e/androidruntime(13098):    @ dalvik.system.nativestart.main(native method) 03-21 10:33:08.100: e/androidruntime(13098): caused by: java.lang.classnotfoundexception: com.example.airlife.mainactivity in loader dalvik.system.pathclassloader[/data/app/com.example.airlife-2.apk] 03-21 10:33:08.100: e/androidruntime(13098):    @ dalvik.system.pathclassloader.findclass(pathclassloader.java:240) 03-21 10:33:08.100: e/androidruntime(13098):    @ java.lang.classloader.loadclass(classloader.java:551) 03-21 10:33:08.100: e/androidruntime(13098):    @ java.lang.classloader.loadclass(classloader.java:511) 03-21 10:33:08.100: e/androidruntime(13098):    @ android.app.instrumentation.newactivity(instrumentation.java:1040) 03-21 10:33:08.100: e/androidruntime(13098):    @ android.app.activitythread.performlaunchactivity(activitythread.java:1777) 03-21 10:33:08.100: e/androidruntime(13098):    ... 11 more 

mainactivity.java

import com.google.android.maps.geopoint; import com.google.android.maps.mapactivity; import com.google.android.maps.mapview; import com.google.android.maps.mylocationoverlay; import android.os.bundle; import android.app.alertdialog; import android.content.dialoginterface; import android.content.intent; import android.view.view; import android.view.view.onclicklistener; import android.widget.edittext; import android.widget.imagebutton; import android.widget.toast;    public class mainactivity extends mapactivity implements onclicklistener{      private imagebutton mvid,magebtn,mweightbtn,mpicbtn,mmsgbtn,mreqbtn,mhelibtn,mdocbtn,mcontextbtn;      private mapview mapview;      private mylocationoverlay mylocationoverlay;       @override     protected void oncreate(bundle savedinstancestate) {           super.oncreate(savedinstancestate);           setcontentview(r.layout.activity_main);           mapview = (mapview)findviewbyid(r.id.webview);            mapview.setbuiltinzoomcontrols(true);           mylocationoverlay = new mylocationoverlay(this, mapview);            mapview.getoverlays().add(mylocationoverlay);             mapview.postinvalidate();             // call convenience method zooms map on our location             zoomtomylocation();            magebtn = (imagebutton) findviewbyid(r.id.imageview36);         mweightbtn = (imagebutton) findviewbyid(r.id.imageview4);         mpicbtn = (imagebutton) findviewbyid(r.id.imageview5);         mmsgbtn = (imagebutton) findviewbyid(r.id.imageview6);         mreqbtn = (imagebutton) findviewbyid(r.id.imageview32);         mhelibtn = (imagebutton) findviewbyid(r.id.btnsearch);         mdocbtn = (imagebutton) findviewbyid(r.id.btnprovide);         mvid = (imagebutton) findviewbyid(r.id.btnpost);         mcontextbtn = (imagebutton) findviewbyid(r.id.btnsettings);            magebtn.setonclicklistener(this);          mweightbtn.setonclicklistener(this);          mpicbtn.setonclicklistener(this);          mmsgbtn.setonclicklistener(this);          mreqbtn.setonclicklistener(this);          mhelibtn.setonclicklistener(this);          mdocbtn.setonclicklistener(this);          mvid.setonclicklistener(this);          mcontextbtn.setonclicklistener(this);       }        @override         protected void onresume() {             super.onresume();             // when our activity resumes, want register location updates             mylocationoverlay.enablemylocation();         }          @override         protected void onpause() {             super.onpause();             // when our activity pauses, want remove listening location updates             mylocationoverlay.disablemylocation();         }          /**          * method zooms user's location zoom level of 10.          */         private void zoomtomylocation() {             geopoint mylocationgeopoint = mylocationoverlay.getmylocation();             if(mylocationgeopoint != null) {                 mapview.getcontroller().animateto(mylocationgeopoint);                 mapview.getcontroller().setzoom(10);             }             else {                 toast.maketext(this, "cannot determine location", toast.length_short).show();             }         }      @override     public void onclick(view v) {         // todo auto-generated method stub          }      @override     protected boolean isroutedisplayed() {         // todo auto-generated method stub         return false;     } 

manifest file:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.example.airlife"     android:versioncode="1"     android:versionname="1.0" >      <uses-sdk         android:minsdkversion="8"         android:targetsdkversion="17" />           <uses-permission android:name="android.permission.write_settings" />          <uses-permission android:name="android.permission.access_fine_location" />     <uses-permission android:name="android.permission.access_wifi_state" />     <uses-permission android:name="android.permission.change_wifi_state" />     <uses-permission android:name="android.permission.internet" />     <uses-permission android:name="android.permission.get_accounts" />     <uses-permission android:name="android.permission.access_network_state"/>     <uses-permission android:name="android.permission.call_phone" />     <uses-permission android:name="android.permission.access_coarse_location" />        <application         android:allowbackup="true"         android:icon="@drawable/ic_launcher"          android:label="@string/app_name"         android:theme="@style/apptheme" >         <activity             android:name="com.example.airlife.mainactivity"             android:label="@string/app_name" >             <intent-filter>                 <action android:name="android.intent.action.main" />                  <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>           <activity android:name=".playvid" />           <activity android:name=".display" />           <activity android:name=".video" />            <activity android:name=".documents" />                  <activity android:name=".contact" />                  <activity android:name=".fixedmylocationoverlay" />      </application>  </manifest> 

please tell me why getting error, , how solve this.

got solution. had missed code in manifest file

    <uses-library android:name="com.google.android.maps"/> 

Comments