这是日志猫 04-17 02:19:25.556: W/-6ren">
gpt4 book ai didi

android - InflateException : Binary XML file line #60: Error inflating class com. 谷歌.android.maps.MapView

转载 作者:行者123 更新时间:2023-11-29 14:54:14 29 4
gpt4 key购买 nike

我一直收到这个错误,我不知道这个错误发生在这个 xml 文件中

?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

</LinearLayout>

这是日志猫

04-17 02:19:25.556: W/dalvikvm(731): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
04-17 02:19:25.586: E/AndroidRuntime(731): FATAL EXCEPTION: main
04-17 02:19:25.586: E/AndroidRuntime(731): java.lang.RuntimeException: Unable to start activity ComponentInfo{sbn.project.gp/sbn.project.gp.Mainevent}: android.view.InflateException: Binary XML file line #60: Error inflating class com.google.android.maps.MapView
04-17 02:19:25.586: E/AndroidRuntime(731): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.os.Handler.dispatchMessage(Handler.java:99)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.os.Looper.loop(Looper.java:123)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.app.ActivityThread.main(ActivityThread.java:4627)
04-17 02:19:25.586: E/AndroidRuntime(731): at java.lang.reflect.Method.invokeNative(Native Method)
04-17 02:19:25.586: E/AndroidRuntime(731): at java.lang.reflect.Method.invoke(Method.java:521)
04-17 02:19:25.586: E/AndroidRuntime(731): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-17 02:19:25.586: E/AndroidRuntime(731): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-17 02:19:25.586: E/AndroidRuntime(731): at dalvik.system.NativeStart.main(Native Method)
04-17 02:19:25.586: E/AndroidRuntime(731): Caused by: android.view.InflateException: Binary XML file line #60: Error inflating class com.google.android.maps.MapView
04-17 02:19:25.586: E/AndroidRuntime(731): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-17 02:19:25.586: E/AndroidRuntime(731): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.app.Activity.setContentView(Activity.java:1647)
04-17 02:19:25.586: E/AndroidRuntime(731): at sbn.project.gp.Mainevent.onCreate(Mainevent.java:27)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-17 02:19:25.586: E/AndroidRuntime(731): ... 11 more
04-17 02:19:25.586: E/AndroidRuntime(731): Caused by: java.lang.reflect.InvocationTargetException
04-17 02:19:25.586: E/AndroidRuntime(731): at com.google.android.maps.MapView.<init>(MapView.java:238)
04-17 02:19:25.586: E/AndroidRuntime(731): at java.lang.reflect.Constructor.constructNative(Native Method)
04-17 02:19:25.586: E/AndroidRuntime(731): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
04-17 02:19:25.586: E/AndroidRuntime(731): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
04-17 02:19:25.586: E/AndroidRuntime(731): ... 21 more
04-17 02:19:25.586: E/AndroidRuntime(731): Caused by: java.lang.IllegalArgumentException: MapViews can only be created inside instances of MapActivity.
04-17 02:19:25.586: E/AndroidRuntime(731): at com.google.android.maps.MapView.<init>(MapView.java:282)
04-17 02:19:25.586: E/AndroidRuntime(731): at com.google.android.maps.MapView.<init>(MapView.java:255)

这是android list

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

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

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

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

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity

android:name=".Main"
android:label="@string/app_name" >
<intent-filter>
<action android:name="tt.pp.ss.MAIN" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity
android:name=".Db"
android:label="@string/app_name" >
<intent-filter>
<action android:name="tt.pp.ss.DB" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".View"
android:label="@string/app_name" >
<intent-filter>
<action android:name="tt.pp.ss.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Mainevent"
android:label="@string/app_name" >
<intent-filter>
<action android:name="tt.pp.ss.MAINEVENT" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Signup"
android:label="@string/app_name" >
<intent-filter>
<action android:name="tt.pp.ss.SIGNUP" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>

</manifest>

任何帮助我已经花了 5 个多小时,但我无法弄明白。

最佳答案

MapViews can only be created inside instances of MapActivity.

你在使用 MapActivity 吗?

关于android - InflateException : Binary XML file line #60: Error inflating class com. 谷歌.android.maps.MapView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10183483/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com