错误:(50,28)找不到与给定名称匹配的资源('value'的值为'@ string / google_maps_key')

时间:2016-02-11 06:39:49

标签: android google-play-services google-maps-android-api-2

我正在使用Android Studio制作Android程序。打开Android Studio和Gradle进程完成后,我得到了

  

错误:(50,28)找不到与给定名称匹配的资源(在'value'处,值为'@ string / google_maps_key')“。

发生了什么事?这是我第一次遇到这个错误。

2 个答案:

答案 0 :(得分:5)

尽管这个问题是几年前的事,但我会为其他人的利益添加答案。您应该看到一个名为/src/debug/res/values/google_maps_api.xml的文件(在下面复制),该文件中有生成和添加地图密钥的说明。替换字段 YOUR_KEY_HERE,带钥匙。

    

To get one, follow this link, follow the directions and press "Create" at the end:

Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">
    YOUR_KEY_HERE
</string>

答案 1 :(得分:0)

使用gradle文件同步项目。