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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:31:37+00:00 2026-05-20T13:31:37+00:00

I am working on my first android project. i am doing a maos based

  • 0

I am working on my first android project. i am doing a maos based application. Buty when I launch I am getting the following error “application stopped due unexpected error.

here is my code. if anything more is required plz do let me know I wil post them

import com.google.android.maps.MapView;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;

public class map extends Activity {
    /** Called when the activity is first created. */
    LinearLayout linearLayout;
    MapView mapView;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mapView = (MapView)findViewById(R.id.mapview);
        mapView.setBuiltInZoomControls(true);
    }
}

this is my layout xml. I have given the apikey too.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mainlayout"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <com.google.android.maps.MapView
     android:id="@+id/mapview"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:apiKey="Api key"
    />
</RelativeLayout>

this is my manifest file.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="rrj.map"
      android:versionCode="1"    
      android:versionName="1.0">

    <uses-sdk android:minSdkVersion="7" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <uses-library android:name="com.google.android.maps" />
        <activity android:name=".map"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
<uses-permission
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:name="android.permission.INTERNET">
    </uses-permission>
    <uses-permission
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:name="android.permission.ACCESS_FINE_LOCATION">
    </uses-permission>
</manifest>

the logcat is down please do help me in pointing out the mistake. I don know how to read the logcat

03-11 00:47:32.856: DEBUG/AndroidRuntime(3209): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
    03-11 00:47:32.856: INFO/AndroidRuntime(3209): Heap size: -Xmx18m
    03-11 00:47:32.856: DEBUG/AndroidRuntime(3209): CheckJNI is OFF
    03-11 00:47:32.861: DEBUG/AndroidRuntime(3209): pLocation:english, pLang: en, pRegn: GB
    03-11 00:47:32.866: DEBUG/AndroidRuntime(3209): setted country_code = India
    03-11 00:47:32.866: ERROR/AndroidRuntime(3209): /system/csc/sales_code.dat ==> cannot open file
    03-11 00:47:32.981: DEBUG/AndroidRuntime(3209): --- registering native functions ---
    03-11 00:47:33.206: DEBUG/ddm-heap(3209): Got feature list request
    03-11 00:47:33.256: INFO/WynexActivity(1981): WindowOrientationChanged: 0
    03-11 00:47:33.371: DEBUG/AndroidRuntime(3209): Shutting down VM
    03-11 00:47:33.371: DEBUG/dalvikvm(3209): DestroyJavaVM waiting for non-daemon threads to exit
    03-11 00:47:33.371: DEBUG/dalvikvm(3209): DestroyJavaVM shutting VM down
    03-11 00:47:33.371: DEBUG/dalvikvm(3209): HeapWorker thread shutting down
    03-11 00:47:33.371: DEBUG/dalvikvm(3209): HeapWorker thread has shut down
    03-11 00:47:33.376: DEBUG/jdwp(3209): JDWP shutting down net...
    03-11 00:47:33.376: INFO/dalvikvm(3209): Debugger has detached; object registry had 1 entries
    03-11 00:47:33.381: DEBUG/dalvikvm(3209): VM cleaning up
    03-11 00:47:33.391: ERROR/AndroidRuntime(3209): ERROR: thread attach failed
    03-11 00:47:33.391: DEBUG/dalvikvm(3209): LinearAlloc 0x0 used 663292 of 5242880 (12%)
    03-11 00:47:33.716: DEBUG/AndroidRuntime(3217): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
    03-11 00:47:33.716: INFO/AndroidRuntime(3217): Heap size: -Xmx18m
    03-11 00:47:33.716: DEBUG/AndroidRuntime(3217): CheckJNI is OFF
    03-11 00:47:33.721: DEBUG/AndroidRuntime(3217): pLocation:english, pLang: en, pRegn: GB
    03-11 00:47:33.726: DEBUG/AndroidRuntime(3217): setted country_code = India
    03-11 00:47:33.726: ERROR/AndroidRuntime(3217): /system/csc/sales_code.dat ==> cannot open file
    03-11 00:47:33.886: DEBUG/AndroidRuntime(3217): --- registering native functions ---
    03-11 00:47:34.111: DEBUG/ddm-heap(3217): Got feature list request
    03-11 00:47:34.281: INFO/ActivityManager(1905): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=rrj.map/.map }
    03-11 00:47:34.286: DEBUG/WynexActivity(1981): ----> onSaveInstanceState()false
    03-11 00:47:34.286: DEBUG/WynexActivity(1981): ----> OnPause()false
    03-11 00:47:34.286: DEBUG/Wynex(1981): ----> OnPauseActivity()
    03-11 00:47:34.301: INFO/ActivityManager(1905): Start proc rrj.map for activity rrj.map/.map: pid=3224 uid=10058 gids={3003}
    03-11 00:47:34.326: DEBUG/AndroidRuntime(3217): Shutting down VM
    03-11 00:47:34.326: DEBUG/dalvikvm(3217): DestroyJavaVM waiting for non-daemon threads to exit
    03-11 00:47:34.326: DEBUG/dalvikvm(3217): DestroyJavaVM shutting VM down
    03-11 00:47:34.326: DEBUG/dalvikvm(3217): HeapWorker thread shutting down
    03-11 00:47:34.331: DEBUG/dalvikvm(3217): HeapWorker thread has shut down
    03-11 00:47:34.331: DEBUG/jdwp(3217): JDWP shutting down net...
    03-11 00:47:34.331: INFO/dalvikvm(3217): Debugger has detached; object registry had 1 entries
    03-11 00:47:34.336: DEBUG/dalvikvm(3217): VM cleaning up
    03-11 00:47:34.351: ERROR/AndroidRuntime(3217): ERROR: thread attach failed
    03-11 00:47:34.356: DEBUG/dalvikvm(3217): LinearAlloc 0x0 used 673260 of 5242880 (12%)
    03-11 00:47:34.421: DEBUG/ddm-heap(3224): Got feature list request
    03-11 00:47:34.461: DEBUG/WynexView(1981): (^^) SURFACE DESTROYED
    03-11 00:47:34.461: DEBUG/WynexView(1981): (^^) <CONSUMER>: AWKE COMSUMER THREAD TO STOP WORKING
    03-11 00:47:34.461: ERROR/WynexView(1981): (^^) <CONSUMER>: THREAD STOP
    03-11 00:47:34.471: DEBUG/WynexActivity(1981): ----> onWindowFocusChanged(false)
    03-11 00:47:34.471: DEBUG/Wynex(1981): ----> OnWindowFocusChanged()
    03-11 00:47:34.596: DEBUG/AndroidRuntime(3224): Shutting down VM
    03-11 00:47:34.601: WARN/dalvikvm(3224): threadid=3: thread exiting with uncaught exception (group=0x4001b180)
    03-11 00:47:34.601: ERROR/AndroidRuntime(3224): Uncaught handler: thread main exiting due to uncaught exception
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224): java.lang.RuntimeException: Unable to start activity ComponentInfo{rrj.map/rrj.map.map}: android.view.InflateException: Binary XML file line #8: Error inflating class com.google.android.maps.MapView
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.os.Handler.dispatchMessage(Handler.java:99)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.os.Looper.loop(Looper.java:123)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.app.ActivityThread.main(ActivityThread.java:4367)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at java.lang.reflect.Method.invokeNative(Native Method)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at java.lang.reflect.Method.invoke(Method.java:521)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at dalvik.system.NativeStart.main(Native Method)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.google.android.maps.MapView
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.app.Activity.setContentView(Activity.java:1622)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at rrj.map.map.onCreate(map.java:18)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     ... 11 more
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224): Caused by: java.lang.reflect.InvocationTargetException
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at com.google.android.maps.MapView.<init>(MapView.java:238)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at java.lang.reflect.Constructor.constructNative(Native Method)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     ... 21 more
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224): Caused by: java.lang.IllegalArgumentException: MapViews can only be created inside instances of MapActivity.
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at com.google.android.maps.MapView.<init>(MapView.java:282)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     at com.google.android.maps.MapView.<init>(MapView.java:255)
    03-11 00:47:34.626: ERROR/AndroidRuntime(3224):     ... 25 more
  • 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-05-20T13:31:38+00:00Added an answer on May 20, 2026 at 1:31 pm

    What jumps out at me 1st is that map activities should extend MapActivity

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

Sidebar

Related Questions

I'm working on my first Android project, and I created a menu via the
I am working with the sample Home application project on http://developer.android.com/resources/samples/Home/index.html I've added another
I have just started working on my first Android application and am going ok.
I did the following: Create a working Android project (not a library or test
I am working on my first Android Application. What I am trying to do
I am working on my first Android Application and I am trying to implement
I have pretty much finished my first working Symbian application, but in my hastened
I'm working on my first Django application. In short, what it needs to do
I am currently working on my first asp.net mvc application. I am trying to
I'm new to iPhone and Apple development and working on my first application. It

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.