gpt4 book ai didi

java - Android Google Play 服务错误 : didn't find class com. google.android.gms.maps.mapfragment 路径 dexpathlist

转载 作者:太空宇宙 更新时间:2023-11-04 14:10:35 24 4
gpt4 key购买 nike

我知道这个问题经常被报告,最简单、经常推荐的解决方案是检查我如何引用 google play 服务库。然而,我非常有信心我已经完成了所有的工作。我确实因为这个错误而失眠了,所以任何建议都值得赞赏。提前致谢。

首先,这是我的堆栈跟踪:

02-06 15:32:12.577: E/AndroidRuntime(17070): java.lang.RuntimeException: Unable to start activity ComponentInfo{raj.wifiapp/raj.wifiapp.MainActivity}: android.view.InflateException: Binary XML file line #29: Error inflating class fragment
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2438)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2497)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.ActivityThread.access$900(ActivityThread.java:168)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.os.Handler.dispatchMessage(Handler.java:102)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.os.Looper.loop(Looper.java:146)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.ActivityThread.main(ActivityThread.java:5678)
02-06 15:32:12.577: E/AndroidRuntime(17070): at java.lang.reflect.Method.invokeNative(Native Method)
02-06 15:32:12.577: E/AndroidRuntime(17070): at java.lang.reflect.Method.invoke(Method.java:515)
02-06 15:32:12.577: E/AndroidRuntime(17070): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
02-06 15:32:12.577: E/AndroidRuntime(17070): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
02-06 15:32:12.577: E/AndroidRuntime(17070): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
02-06 15:32:12.577: E/AndroidRuntime(17070): at dalvik.system.NativeStart.main(Native Method)
02-06 15:32:12.577: E/AndroidRuntime(17070): Caused by: android.view.InflateException: Binary XML file line #29: Error inflating class fragment
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:719)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
02-06 15:32:12.577: E/AndroidRuntime(17070): at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)
02-06 15:32:12.577: E/AndroidRuntime(17070): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:631)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.view.LayoutInflater.inflate(Native Method)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
02-06 15:32:12.577: E/AndroidRuntime(17070): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:350)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.Activity.setContentView(Activity.java:2063)
02-06 15:32:12.577: E/AndroidRuntime(17070): at raj.wifiapp.MainActivity.onCreate(MainActivity.java:58)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.Activity.performCreate(Activity.java:5586)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2402)
02-06 15:32:12.577: E/AndroidRuntime(17070): ... 12 more
02-06 15:32:12.577: E/AndroidRuntime(17070): Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.MapFragment: make sure class name exists, is public, and has an empty constructor that is public
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.Fragment.instantiate(Fragment.java:597)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.Fragment.instantiate(Fragment.java:561)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.Activity.onCreateView(Activity.java:5111)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:695)
02-06 15:32:12.577: E/AndroidRuntime(17070): ... 25 more
02-06 15:32:12.577: E/AndroidRuntime(17070): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.maps.MapFragment" on path: DexPathList[[zip file "/data/app/raj.wifiapp-8.apk"],nativeLibraryDirectories=[/data/app-lib/raj.wifiapp-8, /vendor/lib, /system/lib]]
02-06 15:32:12.577: E/AndroidRuntime(17070): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
02-06 15:32:12.577: E/AndroidRuntime(17070): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
02-06 15:32:12.577: E/AndroidRuntime(17070): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
02-06 15:32:12.577: E/AndroidRuntime(17070): at android.app.Fragment.instantiate(Fragment.java:583)
02-06 15:32:12.577: E/AndroidRuntime(17070): ... 28 more

这是我的 list :

    <?xml version="1.0" encoding="utf-8"?>
<manifest package="raj.wifiapp"
android:versionCode="1"
android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />


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

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<permission
android:name="raj.wifiapp.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />

<uses-permission android:name="raj.wifiapp.permission.MAPS_RECEIVE" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!--
The following two permissions are not required to use
Google Maps Android API v2, but are recommended.
-->

<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" >
<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.API_KEY"
android:value="AIzaSyAaizOmaOj15uOjUmNA4OnowrOLv88_vKI" />

<activity
android:name="raj.wifiapp.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>
<activity android:name="raj.wifiapp.Tracker">
<category android:name="android.intent.category.Default" />
</activity>

</application>

</manifest>

这是我的布局:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
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/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="14dp"
android:text="Switch views" />

<Button
android:id="@+id/btn"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="17dp"
android:text="Scan" />

<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</LinearLayout>

我的声誉低于 10,所以我将发布我的构建路径的屏幕截图链接。

i.stack.imgur.com 斜线 e9F9d.png

i.stack.imgur.com 斜线 wESAc.png

i.stack.imgur.com 斜线 Vb5Vc.png

最佳答案

发生此错误的原因是您尚未在应用项目中添加 Google Play 服务库。请关注以下tutorial在您的应用中添加 Google Play 服务以使 Google map 正常工作。

关于java - Android Google Play 服务错误 : didn't find class com. google.android.gms.maps.mapfragment 路径 dexpathlist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28377045/

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