google map v2 在使用中的问题

来源:互联网 发布:twizzlers 淘宝 编辑:程序博客网 时间:2024/06/05 15:30


google map v2 在使用中的问题

问题:1.Caused by: android.view.InflateException: Binary XML file line #3: Error inflating class fragment

           2.java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable

试通的给留个言


xml里的代码

1.activity 代码

public class MainActivity extends FragmentActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.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"    tools:context=".MainActivity" >    <fragment    android:id="@+id/map"    android:layout_width="match_parent"    android:layout_height="match_parent"    class="com.google.android.gms.maps.SupportMapFragment"/></RelativeLayout>

如果出现这样的问题就 是因jar包没有因好,可以把google-play-services.jar这个jar包导入就可以了还有view4那个jar包没有也得导入

下载地址:点击打开链接

2.如果是出现第二个问题 那就是 你引得lib库没有加载成功,更改项目工作目录一致就行了

如果再使用google map v2中遇到其他什么问题均可留言

原创粉丝点击