小编Ome*_*iko的帖子

Google Maps Android API v2 - 简单的地图应用程序崩溃

我是 android 开发新手 :)

我正在尝试创建一个简单的应用程序:带有地图的活动。我将 HTC 1x 连接到计算机,当我尝试运行该应用程序(通过 Intellij IDEA)时,它崩溃了。

我已经在网络(和 stackoverflow)上搜索过线索,但找不到任何线索。例如:
 - Google Maps v2 - 错误
 -谷歌地图 - 运行时异常 - 错误膨胀类片段

你能告诉我为什么吗??

谢谢,

欧玛



技术细节:

HTC 1x 运行安卓 4.1.1
项目外部库:
 - Android 4.0 谷歌 API
 - Android-Support-V4.jar
 - 谷歌播放服务.jar



主要活动.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent" >
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/地图"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:name="com.google.android.gms.maps.SupportMapFragment"/>
</线性布局>



主要活动.Java

包 com.example.mapTest;

导入 android.os.Bundle;
导入 android.support.v4.app.FragmentActivity;

公共类 MainActivity 扩展 FragmentActivity {
    /**
     * 在第一次创建活动时调用。
     */
    @覆盖
    public void onCreate(Bundle savedInstanceState) { …

android google-maps google-maps-api-2

5
推荐指数
1
解决办法
2544
查看次数

标签 统计

android ×1

google-maps ×1

google-maps-api-2 ×1