Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android GoogleMapsDemo给予非法国家例外_Android_Google Maps_Android Maps - Fatal编程技术网

Android GoogleMapsDemo给予非法国家例外

Android GoogleMapsDemo给予非法国家例外,android,google-maps,android-maps,Android,Google Maps,Android Maps,我已经完成了谷歌的所有步骤,但最后它给出了这个 errorCaused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4132500 but found 0. You must have the following declaration within the <applica

我已经完成了谷歌的所有步骤,但最后它给出了这个

errorCaused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 4132500 but found 0.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
清单文件

对于eclipse,添加以下内容:

<meta-data android:name="com.google.android.gms.version" 
 android:value="@integer/google_play_services_version" />

如果您使用的是带有gradle0.7+的Android Studio(最新版本),请添加以下行:

<meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="Your Key" />

清单文件

对于eclipse,添加以下内容:

<meta-data android:name="com.google.android.gms.version" 
 android:value="@integer/google_play_services_version" />

如果您使用的是带有gradle0.7+的Android Studio(最新版本),请添加以下行:

<meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="Your Key" />

将Google Play services版本添加到应用程序清单中

编辑应用程序的AndroidManifest.xml文件,并添加 元素中的以下声明。这嵌入了 应用程序编译时使用的Google Play服务

您只需将
标记下的
添加到
AndroidManifest.xml

....<application>
    <meta-data android:name="com.google.android.gms.version"  
     android:value="@integer/google_play_services_version" />
    </application>
。。。。

将Google Play services版本添加到应用程序清单中

编辑应用程序的AndroidManifest.xml文件,并添加 元素中的以下声明。这嵌入了 应用程序编译时使用的Google Play服务

您只需将
标记下的
添加到
AndroidManifest.xml

....<application>
    <meta-data android:name="com.google.android.gms.version"  
     android:value="@integer/google_play_services_version" />
    </application>
。。。。

为什么?有什么特别的原因吗?因为最新的文档没有这样的信息。@Paresh Mayani最新的google play服务需要一个版本名,这是在AndroidManifest.xmlNow中提到的。这似乎是一个完美的答案:)您好,我在我的应用程序中这样做了,但我再次遇到错误,原因是:java.lang.RuntimeException:API key not found。检查AndroidManifest元素中的。xml@user2193635发布您的错误,同时发布您的google-play-services_-lib清单。为什么?有什么特别的原因吗?因为最新的文档没有这样的信息。@Paresh Mayani最新的google play服务需要一个版本名,这是在AndroidManifest.xmlNow中提到的。这似乎是一个完美的答案:)您好,我在我的应用程序中这样做了,但我再次遇到错误,原因是:java.lang.RuntimeException:API key not found。检查AndroidManifest元素中的。xml@user2193635发布错误,同时发布google-play-services_-lib清单。发布google-play-services_-lib清单。发布google-play-services_-lib清单。