Note that there are some explanatory texts on larger screens.

plurals
  1. POUnfortunately myAndroidapp has stopped . App include maps
    primarykey
    data
    text
    <p>I am trying to build a google map app on my android device. It was working fine but lately it has been giving error.</p> <p>The app gives error FATAL:MAIN. I am posting the code and the log errors file. Please help me through this. Is there any problem with my android device because the same code was working fine for me. <strong>Android Manifest :-</strong></p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.googlemaps" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"/&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" &gt; &lt;!-- Add Google Map Library --&gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;activity android:label="@string/app_name" android:name=".MapsActivity" &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;meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyBX1XULUbZ8KEpvy60JsDKxmYWtVuIs2X0"/&gt; &lt;/application&gt; &lt;uses-feature android:glEsVersion="0x00020000" android:required="true"/&gt; &lt;permission android:name="com.example.googlemaps.permission.MAPS_RECEIVE" android:protectionLevel="signature"/&gt; &lt;uses-permission android:name="com.example.googlemaps.permission.MAPS_RECEIVE"/&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt; &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt; &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt; &lt;/manifest&gt; </code></pre> <p><strong>MapActivity.java</strong></p> <pre><code> package com.example.googlemaps; 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.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; public class MapsActivity extends FragmentActivity { //Intent in = getIntent(); //String latitude = in.getStringExtra("latitude"); //String longitude = in.getStringExtra("longitude"); GoogleMap googleMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Getting Google Play availability status int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext()); // Showing status if(status!=ConnectionResult.SUCCESS){ // Google Play Services are not available int requestCode = 10; Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this, requestCode); dialog.show(); }else { // Google Play Services are available // Double latitude1=Double.parseDouble(latitude); // Double longitude1=Double.parseDouble(longitude); // Getting reference to the SupportMapFragment of activity_main.xml SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); // Getting GoogleMap object from the fragment googleMap = fm.getMap(); // Enabling MyLocation Layer of Google Map googleMap.setMyLocationEnabled(true); googleMap.addMarker(new MarkerOptions().position(new LatLng(28.62293,77.36403)).title("SaveMe").snippet("Place of Interest").icon(BitmapDescriptorFactory.fromResource(R.drawable.marker))); //System.out.println("Marker added"); // Showing the current location in Google Map googleMap.moveCamera(CameraUpdateFactory.newLatLng(new LatLng(28.62293, 77.36403))); // Zoom in the Google Map googleMap.animateCamera(CameraUpdateFactory.zoomTo(14)); // Setting latitude and longitude in the TextView tv_location } } } </code></pre> <p><strong>mail.xml:-</strong> </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;fragment android:name="com.google.android.gms.maps.SupportMapFragment" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" /&gt; &lt;/LinearLayout&gt; </code></pre> <p><strong>Errors:-</strong></p> <pre><code>05-09 11:28:37.156: W/dalvikvm(27963): threadid=1: thread exiting with uncaught exception (group=0x40aa1210) 05-09 11:28:37.156: E/AndroidRuntime(27963): FATAL EXCEPTION: main 05-09 11:28:37.156: E/AndroidRuntime(27963): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable 05-09 11:28:37.156: E/AndroidRuntime(27963): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source) 05-09 11:28:37.156: E/AndroidRuntime(27963): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 05-09 11:28:37.156: E/AndroidRuntime(27963): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:255) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.app.Activity.setContentView(Activity.java:1835) 05-09 11:28:37.156: E/AndroidRuntime(27963): at com.example.googlemaps.MapsActivity.onCreate(MapsActivity.java:28) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.app.Activity.performCreate(Activity.java:4465) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.app.ActivityThread.access$600(ActivityThread.java:127) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.os.Handler.dispatchMessage(Handler.java:99) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.os.Looper.loop(Looper.java:137) 05-09 11:28:37.156: E/AndroidRuntime(27963): at android.app.ActivityThread.main(ActivityThread.java:4441) 05-09 11:28:37.156: E/AndroidRuntime(27963): at java.lang.reflect.Method.invokeNative(Native Method) 05-09 11:28:37.156: E/AndroidRuntime(27963): at java.lang.reflect.Method.invoke(Method.java:511) 05-09 11:28:37.156: E/AndroidRuntime(27963): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823) 05-09 11:28:37.156: E/AndroidRuntime(27963): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590) 05-09 11:28:37.156: E/AndroidRuntime(27963): at dalvik.system.NativeStart.main(Native Method) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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