Java Android Maps v2只有在首次发布时才起作用

Java Android Maps v2只有在首次发布时才起作用,java,android,eclipse,google-maps,android-maps-v2,Java,Android,Eclipse,Google Maps,Android Maps V2,我遵循应用程序中创建调试密钥的所有步骤。 问题是,当我第一次在eclipse的调试模式下运行应用程序时,一切都很正常,但是如果我重新启动应用程序(不是使用eclipse而是在家中),映射不再工作,它甚至不会出现。。。它只显示一个灰色页面 <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" an

我遵循应用程序中创建调试密钥的所有步骤。 问题是,当我第一次在eclipse的调试模式下运行应用程序时,一切都很正常,但是如果我重新启动应用程序(不是使用eclipse而是在家中),映射不再工作,它甚至不会出现。。。它只显示一个灰色页面

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    android:theme="@android:style/Theme.Light.NoTitleBar"
    android:debuggable="true" >
    <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="MY_KEY" />
我的清单

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    android:theme="@android:style/Theme.Light.NoTitleBar"
    android:debuggable="true" >
    <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="MY_KEY" />
MY_布局

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    android:theme="@android:style/Theme.Light.NoTitleBar"
    android:debuggable="true" >
    <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="MY_KEY" />
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<include
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    layout="@layout/bar_messina" />

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

</LinearLayout>


为什么???

SHA-1键与软件本身有关(本例中为eclipse)。如果项目运行在不同的pc软件上。我怀疑SHA-1的钥匙是不同的。更改SHA-1密钥。请参阅您的软件,看看是否有帮助。

您可以发布日志吗?您正在重新启动同一应用程序,还是导出apk文件?我的意思是,应用程序仍处于调试模式?那么,如果你连接了你的设备,你能看到日志吗?我还没有导出.apk文件。。。Eclipse将其保存在我的手机上,然后当我拔下USB接口时,地图不再工作。我没有在不同的pc软件中运行它,我只是在不使用Eclipse的情况下运行它。。。只需从my phone应用程序的菜单中选择它,然后尝试清除应用程序的缓存和数据,这样就可以在新手机上启动应用程序。我不知道为什么,但它创建了两个同名的应用程序和相同的包。。。我删除了所有的应用程序,它工作得很好
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    android:theme="@android:style/Theme.Light.NoTitleBar"
    android:debuggable="true" >
    <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="MY_KEY" />