RuntimeException android

RuntimeException android,android,exception,logcat,Android,Exception,Logcat,我不明白这段代码有什么问题,为什么会抛出这个异常,下面是我的main.xml和logcat 清单文件: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.testing" android:versionCode="1" android:version

我不明白这段代码有什么问题,为什么会抛出这个异常,下面是我的main.xml和logcat

清单文件:

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

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="19" />

    <permission
        android:name="com.example.testing.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.fotech.closeups.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_MOCK_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.testing.MainActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            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>

</manifest>
activity_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"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context=".MainActivity" >

        <Button 
          android:id="@+id/showBtn"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:text="@string/show"
          />

      <fragment 
            xmlns:map="http://schemas.android.com/apk/res-auto" 
              android:id="@+id/map"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_above="@id/showBtn"
              android:name="com.google.android.gms.maps.SupportMapFragment"
              map:cameraZoom="5"
              map:cameraTilt="30"
              map:uiCompass="false"
              map:uiRotateGestures="true"
              map:uiTiltGestures="true"
              map:uiZoomGestures="true"
              />
</RelativeLayout>
感谢您的合作。

您的
minsdk=“14”
。您需要使用
MapFragment
而不是
SupportMapFragment

 android:name="com.google.android.gms.maps.MapFragment"
还扩展了
main活动
extends
Activity

并尝试使用

  map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
您的
minsdk=“14”
。您需要使用
MapFragment
而不是
SupportMapFragment

 android:name="com.google.android.gms.maps.MapFragment"
还扩展了
main活动
extends
Activity

并尝试使用

  map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
您的
minsdk=“14”
。您需要使用
MapFragment
而不是
SupportMapFragment

 android:name="com.google.android.gms.maps.MapFragment"
还扩展了
main活动
extends
Activity

并尝试使用

  map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
您的
minsdk=“14”
。您需要使用
MapFragment
而不是
SupportMapFragment

 android:name="com.google.android.gms.maps.MapFragment"
还扩展了
main活动
extends
Activity

并尝试使用

  map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();

在xml文件中发布MainActivity代码…@olrC将
.Main
替换为
.MainActivity
@PRAKASHUBHADIYA在发布问题之前已经完成了,但这并没有解决问题error@oIrC现在发布manifest.xml文件,将这个xmlns:map=“”放在顶部布局,并将其从片段xml中删除,将android:name更改为class=post你的MainActivity代码…@olrC在你的xml文件中将
.Main
替换为
.MainActivity
@PRAKASHUBHADIYA在发布问题之前已经完成了,但这并没有解决问题error@oIrC现在发布manifest.xml文件,将这个xmlns:map=“”放在顶部布局,并将其从片段xml中删除,将android:name更改为class=post你的MainActivity代码…@olrC在你的xml文件中将
.Main
替换为
.MainActivity
@PRAKASHUBHADIYA在发布问题之前已经完成了,但这并没有解决问题error@oIrC现在发布manifest.xml文件,将这个xmlns:map=“”放在顶部布局,并将其从片段xml中删除,将android:name更改为class=post你的MainActivity代码…@olrC在你的xml文件中将
.Main
替换为
.MainActivity
@PRAKASHUBHADIYA在发布问题之前已经完成了,但这并没有解决问题error@oIrC现在发布manifest.xml文件,将这个xmlns:map=“”放在顶部布局,并将其从片段xml中删除,将android:name更改为class=此行无效:map=
((MapFragment)getFragmentManager().findFragmentById(R.id.map)).getMap()此行不起作用:map=
((MapFragment)getFragmentManager().findFragmentById(R.id.map)).getMap()此行不起作用:map=
((MapFragment)getFragmentManager().findFragmentById(R.id.map)).getMap()此行不起作用:map=
((MapFragment)getFragmentManager().findFragmentById(R.id.map)).getMap()