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 9251529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:43:27+00:00 2026-06-18T10:43:27+00:00

I am trying to make a simple app that shows google maps on my

  • 0

I am trying to make a simple app that shows google maps on my device. I run it in my Alcatel OT 990 android device (v. 2.2.2) but it shows the error message “Application has stopped unexpectedly…. then force close”. I believe I’m doing everything right, since i follow the instructions from a youtube tutorial that works.
This is my code (I’ ve included Android Support Library, Google Play Services Library and android.jar):

Manifest

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />
<permission
    android:name="com.xristina.maps.permission.MAPS_RECEIVE"
    android:protectionLevel="signature"/>
<uses-permission android:name="com.xristina.maps.permission.MAPS_RECEIVE"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>

<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:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.tutorialgooglemaps.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="*************my key here*********************"/>
</application>

main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<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.SupportMapFragment"/>

</RelativeLayout>

MainActivity.java

package com.xristina.maps;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.os.Bundle;
import android.view.Menu;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.SupportMapFragment;
public class MainActivity extends android.support.v4.app.FragmentActivity {

private GoogleMap mMap;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    setUpMapIfNeeded();

}

@Override
protected void onResume() {
    super.onResume();
    setUpMapIfNeeded();
}

private void setUpMapIfNeeded() {
    if (mMap == null) {
        mMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map))
                .getMap();
        if (mMap != null) {
            setUpMap();
        }
    }
}

private void setUpMap() {
    mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker"));
}
}

Any ideas please??

Ι added the code suggested by @BBonDoo and the logcat result was:

02-06 16:59:34.807: W/dalvikvm(2735): threadid=1: thread exiting with uncaught exception (group=0x400207d8)
02-06 16:59:34.817: E/AndroidRuntime(2735): FATAL EXCEPTION: main
02-06 16:59:34.817: E/AndroidRuntime(2735): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.xristina.maps/com.example.tutorialgooglemaps.MainActivity}: java.lang.ClassNotFoundException: com.example.tutorialgooglemaps.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.xristina.maps-2.apk]
02-06 16:59:34.817: E/AndroidRuntime(2735):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2603)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2697)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at android.app.ActivityThread.access$2300(ActivityThread.java:126)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2051)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at android.os.Looper.loop(Looper.java:123)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at android.app.ActivityThread.main(ActivityThread.java:4645)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at java.lang.reflect.Method.invokeNative(Native Method)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at java.lang.reflect.Method.invoke(Method.java:521)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at dalvik.system.NativeStart.main(Native Method)
02-06 16:59:34.817: E/AndroidRuntime(2735): Caused by: java.lang.ClassNotFoundException: com.example.tutorialgooglemaps.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.xristina.maps-2.apk]
02-06 16:59:34.817: E/AndroidRuntime(2735):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at android.app.Instrumentation.newActivity(Instrumentation.java:1022)
02-06 16:59:34.817: E/AndroidRuntime(2735):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2595)
02-06 16:59:34.817: E/AndroidRuntime(2735):     ... 11 more

I also have to say that this code wasn’t included in the tutorial i studied at
http://www.youtube.com/watch?v=mRnEkP2q4fo and http://www.youtube.com/watch?v=OZRgiwGfvSQ

  • 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-18T10:43:29+00:00Added an answer on June 18, 2026 at 10:43 am

    [Answer new ]…added update]

    Your Logcat is good. It means as follows;

    Please look into two pictures and match your package name(①) with the correct one(②).

    This is your manifest file

    This is your java file

    Please replace the package name in the manifest file with the package name in your java file.

    It is correct code in your manifest file;

    <Activity
         android:name="com.xristina.maps.MainActivity"
         ...
    

    [Answer old]

    You did not finish writing the code enough to display Google Maps in your MainActivity.java. Please fill your code with the code as shown in the below, which is the basic code you must know essentially in order to display the Google Maps in Android platform:

    public class MianActivity extends android.support.v4.app.FragmentActivity {
    
        private GoogleMap mMap;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            setUpMapIfNeeded();
    
        }
    
        @Override
        protected void onResume() {
            super.onResume();
            setUpMapIfNeeded();
        }
    
        private void setUpMapIfNeeded() {
            if (mMap == null) {
                mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
                        .getMap();
                if (mMap != null) {
                    setUpMap();
                }
            }
        }
    
        private void setUpMap() {
            mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker"));
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a simple app that sits on the Mac OSX menu
I'm trying to make a very simple updater app that reads current version.txt file
I'm trying to make a simple drawing app in c++, but i'm having trouble
I am trying to make a simple app that read from a midi port
I am trying to make simple app that allows one to compare image to
I am trying to make a simple android app. It is supposed to show
Hi I am trying to make an app that shows a list of items
I'm trying to make an app that plays live http streaming on android (i
I'm trying to make a simple Windows form app that does things. I'd like
I'm trying to make a simple app that will ping a uri and tell

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.