android - App with Google Map crashes when I extend FragmentActivity -


i know question has been asked many times here, none of solutions provided stopped app crashing.

here code mainactivity:

package com.example.gpstracking2;  import android.os.bundle; import android.app.activity; import android.view.menu; import android.app.dialog; import android.os.bundle; import android.support.v4.app.fragmentactivity;  import com.google.android.gms.common.connectionresult; import com.google.android.gms.common.googleplayservicesutil; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.supportmapfragment; import com.google.android.gms.maps.model.marker;  public class mainactivity extends fragmentactivity {  googlemap googlemap;  marker marker = null;  @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main); }   @override public boolean oncreateoptionsmenu(menu menu) {     // inflate menu; adds items action bar if present.     getmenuinflater().inflate(r.menu.main, menu);     return true; }  } 

here code activity_main.xml layout folder:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >  <fragment     android:name="com.google.android.gms.maps.supportmapfragment"     xmlns:map="http://schemas.android.com/apk/res-auto"     android:id="@+id/map"     android:layout_width="match_parent"     android:layout_height="match_parent" />  </linearlayout> 

here manifest file:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.gpstracking2" android:versioncode="1" android:versionname="1.0" >  <uses-sdk     android:minsdkversion="8"     android:targetsdkversion="17" />  <permission android:name="com.example.gpstracking2.permission.maps_receive"   android:protectionlevel="signature"/> <uses-permission android:name="com.example.gpstracking2.permission.maps_receive"/> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.write_external_storage"/> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices"/> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" />  <uses-feature android:glesversion="0x00020000" android:required="true"/>  <application     android:allowbackup="true"     android:icon="@drawable/ic_launcher"     android:label="@string/app_name"     android:theme="@style/apptheme" >     <activity         android:name="com.example.gpstracking2.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>      <meta-data     android:name="com.google.android.maps.v2.api_key"     android:value="key"/> </application>  </manifest> 

and here logcat:

10-06 16:57:27.966: w/dalvikvm(6735): vfy: unable resolve static field 1346    (mapattrs) in lcom/google/android/gms/r$styleable; 10-06 16:57:27.966: d/dalvikvm(6735): vfy: replacing opcode 0x62 @ 0x000e 10-06 16:57:27.966: d/androidruntime(6735): shutting down vm 10-06 16:57:27.966: w/dalvikvm(6735): threadid=1: thread exiting uncaught exception (group=0x41df3700) 10-06 16:57:27.966: e/androidruntime(6735): fatal exception: main 10-06 16:57:27.966: e/androidruntime(6735): java.lang.noclassdeffounderror:   com.google.android.gms.r$styleable 10-06 16:57:27.966: e/androidruntime(6735):     @   com.google.android.gms.maps.googlemapoptions.createfromattributes(unknown source) 10-06 16:57:27.966: e/androidruntime(6735):     @ com.google.android.gms.maps.supportmapfragment.oninflate(unknown source) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.support.v4.app.fragmentactivity.oncreateview(fragmentactivity.java:284) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:685) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.view.layoutinflater.rinflate(layoutinflater.java:755) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.view.layoutinflater.inflate(layoutinflater.java:492) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.view.layoutinflater.inflate(layoutinflater.java:397) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.view.layoutinflater.inflate(layoutinflater.java:353) 10-06 16:57:27.966: e/androidruntime(6735):     @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:267) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.app.activity.setcontentview(activity.java:1895) 10-06 16:57:27.966: e/androidruntime(6735):     @ com.example.gpstracking2.mainactivity.oncreate(mainactivity.java:25) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.app.activity.performcreate(activity.java:5133) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1087) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.app.activitythread.performlaunchactivity(activitythread.java:2175) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.app.activitythread.handlelaunchactivity(activitythread.java:2261) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.app.activitythread.access$600(activitythread.java:141) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.app.activitythread$h.handlemessage(activitythread.java:1256) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.os.handler.dispatchmessage(handler.java:99) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.os.looper.loop(looper.java:137) 10-06 16:57:27.966: e/androidruntime(6735):     @ android.app.activitythread.main(activitythread.java:5103) 10-06 16:57:27.966: e/androidruntime(6735):     @ java.lang.reflect.method.invokenative(native method) 10-06 16:57:27.966: e/androidruntime(6735):     @ java.lang.reflect.method.invoke(method.java:525) 10-06 16:57:27.966: e/androidruntime(6735):     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:737) 10-06 16:57:27.966: e/androidruntime(6735):     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553) 10-06 16:57:27.966: e/androidruntime(6735):     @ dalvik.system.nativestart.main(native method) 10-06 16:57:27.976: w/activitymanager(428):   force finishing activity com.example.gpstracking2/.mainactivity 10-06 16:57:28.056: d/dalvikvm(428): gc_for_alloc freed 2309k, 20% free 17147k/21256k, paused 68ms, total 68ms 10-06 16:57:28.566: w/activitymanager(428): activity pause timeout activityrecord{42889d90 u0 com.example.gpstracking2/.mainactivity} 10-06 16:57:28.616: i/activitymanager(428): no longer want com.android.defcontainer (pid 5432): empty #17 10-06 16:57:29.876: i/process(6735): sending signal. pid: 6735 sig: 9 10-06 16:57:29.876: i/activitymanager(428): process com.example.gpstracking2 (pid 6735) has died. 10-06 16:57:29.896: w/inputmethodmanagerservice(428): window focused, ignoring   focus gain of: com.android.internal.view.iinputmethodclient$stub$proxy@4266be70   attribute=null, token = android.os.binderproxy@425f0da8 

library not added properly.. check project -> right click on properties -.java build path -order , exprot select googleplayservices library.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -