在android上设置Google maps API v2,错误膨胀类片段

在android上设置Google maps API v2,错误膨胀类片段,第1张

概述所以我正在关注 Android的Google maps API v2,尝试在屏幕上获取基本地图.在完成所有步骤后,我得到一个“错误膨胀片段”其他人遇到了同样的问题,但没有一个解决方案似乎工作. 确切错误:android.view.InflateException:二进制XML文件行#10:错误膨胀类片段 的.java: import android.os.Bundle;import andro 所以我正在关注 Android的Google maps API v2,尝试在屏幕上获取基本地图.在完成所有步骤后,我得到一个“错误膨胀类片段”其他人遇到了同样的问题,但没有一个解决方案似乎工作.
确切错误:androID.vIEw.InflateException:二进制XML文件行#10:错误膨胀类片段

的.java:

import androID.os.Bundle;import androID.vIEw.Menu;import androID.support.v4.app.FragmentActivity;public class GoogleMaps extends FragmentActivity {    @OverrIDe    protected voID onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentVIEw(R.layout.activity_Google_maps);    }    @OverrIDe    public boolean onCreateOptionsMenu(Menu menu) {        // Inflate the menu; this adds items to the action bar if it is present.        getMenuInflater().inflate(R.menu.Google_maps,menu);        return true;    }}

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=".GoogleMaps" >    <fragment         androID:ID="@+ID/map"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"                androID:name="com.testing.svma.MainActivity"/></relativeLayout>

我想我已经正确设置了Google Play服务,它要求在第一次导航到页面时下载它们.这是我的project.propertIEs:

# Project target.target=androID-17androID.library=falseandroID.library.reference.1=../../../androID-sdks/extras/Google/Google_play_services/libproject/Google-play-services_lib

原木猫:

...03-06 21:12:44.751: I/System.out(9122): DeBUGger has connected03-06 21:12:44.751: I/System.out(9122): waiting for deBUGger to settle...03-06 21:12:46.166: I/System.out(9122): deBUGger has settled (1487)03-06 21:12:50.634: D/dalvikvm(9122): DexOpt: Couldn't find fIEld LandroID/content/res/Configuration;.smallestScreenWIDthDp03-06 21:12:50.634: W/dalvikvm(9122): VFY: unable to resolve instance fIEld 2303-06 21:12:50.634: D/dalvikvm(9122): VFY: replacing opcode 0x52 at 0x001203-06 21:12:50.634: D/dalvikvm(9122): VFY: dead code 0x0014-0018 in Lcom/Google/androID/gms/common/GooglePlayServicesUtil;.b (LandroID/content/res/Resources;)Z03-06 21:12:51.126: W/dalvikvm(9122): Unable to resolve superclass of Lmaps/p/s; (427)03-06 21:12:51.126: W/dalvikvm(9122): link of class 'Lmaps/p/s;' Failed03-06 21:12:51.126: W/dalvikvm(9122): Unable to resolve superclass of Lmaps/y/bo; (3820)03-06 21:12:51.126: W/dalvikvm(9122): link of class 'Lmaps/y/bo;' Failed03-06 21:12:51.126: W/dalvikvm(9122): Unable to resolve superclass of Lmaps/i/k; (4208)03-06 21:12:51.126: W/dalvikvm(9122): link of class 'Lmaps/i/k;' Failed03-06 21:12:51.126: E/dalvikvm(9122): Could not find class 'maps.i.k',referenced from method maps.z.ag.a03-06 21:12:51.126: W/dalvikvm(9122): VFY: unable to resolve new-instance 3540 (Lmaps/i/k;) in Lmaps/z/ag;03-06 21:12:51.126: D/dalvikvm(9122): VFY: replacing opcode 0x22 at 0x006d03-06 21:12:51.149: D/dalvikvm(9122): VFY: dead code 0x006f-007f in Lmaps/z/ag;.a (LandroID/vIEw/LayoutInflater;Lcom/Google/androID/gms/maps/GoogleMapOptions;ZLjava/lang/String;)Lmaps/z/ag;

我试过这些线程的解决方案没有运气:

Error inflating class fragment

Google Maps V2 – Error inflating class Fragment

我也只是按照本教程得到了同样的错误:

https://www.youtube.com/watch?v=OZRgiwGfvSQ

解决方法 此问题通常源于您的项目缺少androID支持库的事实.发生这种情况是因为旧版本的API片段不存在,因此您需要添加此库以便在旧版AndroID中添加对片段的支持.

要执行此 *** 作,请右键单击您的项目,然后:

此外,您可以浏览我在您的应用程序中实施Google地图时写的博文:

Google Maps API V2

总结

以上是内存溢出为你收集整理的在android上设置Google maps API v2,错误膨胀类片段全部内容,希望文章能够帮你解决在android上设置Google maps API v2,错误膨胀类片段所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1127370.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存