应用已意外停止

时间:2015-02-02 13:57:51

标签: android google-maps-android-api-2 google-maps-api-2

我尝试从此页https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2

运行谷歌地图

这是我的

.java页面

package com.findyourtaxihere.taxi;


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

public class MainActivity extends Activity {

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

这是清单

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

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21" />
    <permission
        android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <uses-permission android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <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" />


    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <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.gms.version"
    android:value="@integer/google_play_services_version" />
        <meta-data
    android:name="com.google.android.maps.v2.my api"
    android:value="my api"/>
    </application>

</manifest>

我的活动主要

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:name="com.google.android.gms.maps.MapFragment"/>

当我运行我的应用程序时,它显示错误就像这样停止不幸,并且我是新的android请帮助我!  日志

02-02 19:03:54.871: I/Process(284): Sending signal. PID: 284 SIG: 9
02-02 19:04:00.491: D/AndroidRuntime(307): Shutting down VM
02-02 19:04:00.491: W/dalvikvm(307): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:04:00.511: E/AndroidRuntime(307): FATAL EXCEPTION: main
02-02 19:04:00.511: E/AndroidRuntime(307): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.os.Looper.loop(Looper.java:123)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:04:00.511: E/AndroidRuntime(307):  at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:04:00.511: E/AndroidRuntime(307):  at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:04:00.511: E/AndroidRuntime(307):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:04:00.511: E/AndroidRuntime(307):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:04:00.511: E/AndroidRuntime(307):  at dalvik.system.NativeStart.main(Native Method)
02-02 19:04:00.511: E/AndroidRuntime(307): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:04:00.511: E/AndroidRuntime(307):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:04:00.511: E/AndroidRuntime(307):  at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:13)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:04:00.511: E/AndroidRuntime(307):  ... 11 more
02-02 19:04:00.511: E/AndroidRuntime(307): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-2.apk]
02-02 19:04:00.511: E/AndroidRuntime(307):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:04:00.511: E/AndroidRuntime(307):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:04:00.511: E/AndroidRuntime(307):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:04:00.511: E/AndroidRuntime(307):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:04:00.511: E/AndroidRuntime(307):  ... 19 more
02-02 19:09:36.841: I/dalvikvm(334): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:09:36.841: W/dalvikvm(334): VFY: unable to resolve virtual method 12505: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:09:36.841: D/dalvikvm(334): VFY: replacing opcode 0x6e at 0x0009
02-02 19:09:36.852: D/dalvikvm(334): VFY: dead code 0x000c-0019 in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:09:36.922: D/AndroidRuntime(334): Shutting down VM
02-02 19:09:36.922: W/dalvikvm(334): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:09:36.942: E/AndroidRuntime(334): FATAL EXCEPTION: main
02-02 19:09:36.942: E/AndroidRuntime(334): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.os.Looper.loop(Looper.java:123)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:09:36.942: E/AndroidRuntime(334):  at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:09:36.942: E/AndroidRuntime(334):  at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:09:36.942: E/AndroidRuntime(334):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:09:36.942: E/AndroidRuntime(334):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:09:36.942: E/AndroidRuntime(334):  at dalvik.system.NativeStart.main(Native Method)
02-02 19:09:36.942: E/AndroidRuntime(334): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:09:36.942: E/AndroidRuntime(334):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:09:36.942: E/AndroidRuntime(334):  at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:18)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:09:36.942: E/AndroidRuntime(334):  ... 11 more
02-02 19:09:36.942: E/AndroidRuntime(334): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:09:36.942: E/AndroidRuntime(334):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:09:36.942: E/AndroidRuntime(334):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:09:36.942: E/AndroidRuntime(334):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:09:36.942: E/AndroidRuntime(334):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:09:36.942: E/AndroidRuntime(334):  ... 19 more
02-02 19:09:40.241: I/Process(334): Sending signal. PID: 334 SIG: 9
02-02 19:15:23.312: I/dalvikvm(370): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:15:23.312: W/dalvikvm(370): VFY: unable to resolve virtual method 12505: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:15:23.312: D/dalvikvm(370): VFY: replacing opcode 0x6e at 0x0009
02-02 19:15:23.322: D/dalvikvm(370): VFY: dead code 0x000c-0019 in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:15:23.392: D/AndroidRuntime(370): Shutting down VM
02-02 19:15:23.392: W/dalvikvm(370): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:15:23.422: E/AndroidRuntime(370): FATAL EXCEPTION: main
02-02 19:15:23.422: E/AndroidRuntime(370): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.os.Looper.loop(Looper.java:123)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:15:23.422: E/AndroidRuntime(370):  at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:15:23.422: E/AndroidRuntime(370):  at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:15:23.422: E/AndroidRuntime(370):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:15:23.422: E/AndroidRuntime(370):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:15:23.422: E/AndroidRuntime(370):  at dalvik.system.NativeStart.main(Native Method)
02-02 19:15:23.422: E/AndroidRuntime(370): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:15:23.422: E/AndroidRuntime(370):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:15:23.422: E/AndroidRuntime(370):  at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:18)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:15:23.422: E/AndroidRuntime(370):  ... 11 more
02-02 19:15:23.422: E/AndroidRuntime(370): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-2.apk]
02-02 19:15:23.422: E/AndroidRuntime(370):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:15:23.422: E/AndroidRuntime(370):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:15:23.422: E/AndroidRuntime(370):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:15:23.422: E/AndroidRuntime(370):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:15:23.422: E/AndroidRuntime(370):  ... 19 more
02-02 19:15:26.542: I/Process(370): Sending signal. PID: 370 SIG: 9
02-02 19:18:15.771: I/dalvikvm(397): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:18:15.771: W/dalvikvm(397): VFY: unable to resolve virtual method 12506: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:18:15.771: D/dalvikvm(397): VFY: replacing opcode 0x6e at 0x0009
02-02 19:18:15.782: D/dalvikvm(397): VFY: dead code 0x000c-005e in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:18:15.821: D/AndroidRuntime(397): Shutting down VM
02-02 19:18:15.821: W/dalvikvm(397): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:18:15.851: E/AndroidRuntime(397): FATAL EXCEPTION: main
02-02 19:18:15.851: E/AndroidRuntime(397): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.os.Looper.loop(Looper.java:123)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:18:15.851: E/AndroidRuntime(397):  at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:18:15.851: E/AndroidRuntime(397):  at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:18:15.851: E/AndroidRuntime(397):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:18:15.851: E/AndroidRuntime(397):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:18:15.851: E/AndroidRuntime(397):  at dalvik.system.NativeStart.main(Native Method)
02-02 19:18:15.851: E/AndroidRuntime(397): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:18:15.851: E/AndroidRuntime(397):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:18:15.851: E/AndroidRuntime(397):  at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:20)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:18:15.851: E/AndroidRuntime(397):  ... 11 more
02-02 19:18:15.851: E/AndroidRuntime(397): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:18:15.851: E/AndroidRuntime(397):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:18:15.851: E/AndroidRuntime(397):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:18:15.851: E/AndroidRuntime(397):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:18:15.851: E/AndroidRuntime(397):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:18:15.851: E/AndroidRuntime(397):  ... 19 more
02-02 19:22:23.441: D/AndroidRuntime(453): Shutting down VM
02-02 19:22:23.441: W/dalvikvm(453): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:22:23.471: E/AndroidRuntime(453): FATAL EXCEPTION: main
02-02 19:22:23.471: E/AndroidRuntime(453): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.os.Looper.loop(Looper.java:123)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:22:23.471: E/AndroidRuntime(453):  at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:22:23.471: E/AndroidRuntime(453):  at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:22:23.471: E/AndroidRuntime(453):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:22:23.471: E/AndroidRuntime(453):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:22:23.471: E/AndroidRuntime(453):  at dalvik.system.NativeStart.main(Native Method)
02-02 19:22:23.471: E/AndroidRuntime(453): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:22:23.471: E/AndroidRuntime(453):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:22:23.471: E/AndroidRuntime(453):  at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:16)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:22:23.471: E/AndroidRuntime(453):  ... 11 more
02-02 19:22:23.471: E/AndroidRuntime(453): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:22:23.471: E/AndroidRuntime(453):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:22:23.471: E/AndroidRuntime(453):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:22:23.471: E/AndroidRuntime(453):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:22:23.471: E/AndroidRuntime(453):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:22:23.471: E/AndroidRuntime(453):  ... 19 more
02-02 19:27:23.551: I/Process(453): Sending signal. PID: 453 SIG: 9

1 个答案:

答案 0 :(得分:1)

您需要将min SDK设置为11,因此代码只能在Activity知道如何夸大fragment代码的设备上运行。

或者只使用v4支持库并更改您的活动以扩展FragmentActivity