Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9182407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:33:13+00:00 2026-06-17T18:33:13+00:00

I am trying to add google maps to my android application, and I followed

  • 0

I am trying to add google maps to my android application, and I followed this documentation: https://developers.google.com/maps/documentation/android/start

First off, is my Manifest file correct?

Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="where.is.the.action"
          android:versionCode="1"
          android:versionName="1.0">
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>
    <permission
        android:name="where.is.the.action.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/>
    <uses-permission android:name="where.is.the.action.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"/>
    <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
        <activity android:name="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="xxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
    </application>
</manifest>

Then here is my layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
    <Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="My Location"
        android:onClick="getLocation"
        android:layout_weight="0"
    />
    <fragment xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/map"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              class="com.google.android.gms.maps.MapFragment"/>
</LinearLayout>

It works fine if I remove the fragment tag, but once I add it back in the app closes and displays: “Unfortunately, MainActivity has stopped.”

Does anyone see what is wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:33:14+00:00Added an answer on June 17, 2026 at 6:33 pm

    Perhaps you are trying to use MapFragment on a device that is not running Android 3.0+. MapFragment is for use with an Activity and the native fragment implementation from API Level 11. SupportMapFragment is for use with a FragmentActivity and the fragment backport supplied by the Android Support Library.


    UPDATE

    Upon further review, the problem is probably two-fold:

    1. You attempted to attach google-play-services.jar to your project, instead of following the instructions and attaching the Play Services Android library project to your project.

    2. You did #1 above by messing with your build path directly, instead of copying the JAR to libs/.

    Undo what you did originally. Then, follow the instructions to attach the Android library project to your project (which, as a side effect, will properly set up that JAR for you).

    Since it appears that you are doing a command-line build, you will need to create the command-line build files for the Android library project, which Google elected not to ship (grrrrrrrrrrrrrrr). Run:

    android update project -p /home/ryan/android-sdk-linux/extras/google/google_play_services/libproject/googl‌​e-play-services_lib
    

    to create the necessary files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to actionbarsherlock with google maps. Following this youtube link(http://www.youtube.com/watch?v=avcp6eD_X2k), I've managed
I am trying to add a jquery accordion (http://jqueryui.com/demos/accordion/) inside a google maps infoBubble
I'm trying to add a few tweets to an infowindow in Google Maps. I
I am trying to add a google map to my android tablet to detect
I'm trying to add markers on my Google Maps V3. I want to have
I am trying to use the Google maps API on my android app. I
I have been trying to add a link to Google Maps so that I
I am new to Javascript and Google Maps and I am trying to add
I am trying to add a Google Maps view using the version 2 API
I'm trying to use the Google Maps API v2 in an android project that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.