MapView应用程序崩溃了

时间:2011-03-08 20:33:08

标签: android google-maps android-emulator

我正在尝试制作Android地图应用。由于我是这些人的新手,我正在摆弄基础知识所以我决定创建一个地图,显示一个按钮和数字时钟。

当我运行项目时,模拟器会加载,但是当它尝试加载应用程序时,它会强制关闭。

我的main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <DigitalClock android:text="@+id/DigitalClock01"
        android:id="@+id/DigitalClock01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"></DigitalClock>
    <Button android:text="@+id/Button01"
        android:layout_width="wrap_content"
        android:id="@+id/Button01"
        android:layout_height="wrap_content"></Button>
    <com.google.android.maps.MapView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:apiKey="xyz_my_key" />
</LinearLayout>

在我的清单中,我添加了uses-library定义

  <uses-library android:name="com.google.android.maps"/>

我还添加了互联网使用权限

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

为什么会崩溃?

错误日志中的最后一个条目:

  

运行时没有命令输出:'am   开始-n   com.example.android.google.apis / com.example.android.google.apis.com.example.android.apis.MapsDemo   -a android.intent.action.MAIN -c android.intent.category.LAUNCHER'​​on   设备模拟器-5554

1 个答案:

答案 0 :(得分:0)

我没有正确设置项目。我已经重新开始重新复制并粘贴了源代码并且嘿presto它工作

相关问题