Adz*_*Adz 88 android google-play-services google-maps-android-api-2
我正在关注本教程:https://developers.google.com/maps/documentation/android/start#overview ,了解如何将Google地图添加到Android SDK中的应用.
我似乎唯一的问题就是在这一点上(我做了其他一切没有错误):
Edit your application's AndroidManifest.xml file, and add the following declaration within the
<application> element. This embeds the version of Google Play services that the app was compiled with.
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
The error is:
No resources found that match the given name (at 'value' with value '@integer/
google_play_services_version').
Run Code Online (Sandbox Code Playgroud)
我试图按照这个人解决方案来解决同样的问题:Google Play服务库更新和缺少符号@ integer/google_play_services_version
但我仍然得到同样的错误.有什么帮助吗?
Ewo*_*oks 99
可能是您的库没有正确链接到项目,或者您有较旧的google-play-services库版本,因此出现冲突并且Eclipse变得愚蠢......:S
不,你不需要在integers.xml中添加任何东西.当您将Google-play-services库正确链接到您的项目参考android:value="@integer/google_play_services_version"时,您将找到并准备就绪.当你将库添加到你的项目时,只需要做一个更干净,如此有趣的Eclipse环境正确地扫除事物.
如果您在下一个播放版本到来时将此数字硬编码,则需要更新它.如果你忘记了,你会花时间再寻找bug ..:S
希望它有所帮助.;)
Vra*_*esh 36
我得到了解决方案.
第3步:在库部分添加库...(google-play-services_lib)
请参阅下面的小写
<android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/
Joa*_*huk 22
在Android Studio中,您只需将其添加到Gradle文件即可解决此问题:
compile 'com.google.android.gms:play-services:6.5.87'
Run Code Online (Sandbox Code Playgroud)
编辑
现在,由于更新和新的Gradle API,您应该使用的是:
implementation 'com.google.android.gms:play-services:12.0.0'
Run Code Online (Sandbox Code Playgroud)
一个更重要的提示:避免使用捆绑版本的Google Play服务,但请考虑声明应用程序需要减少其大小的依赖项,以及减少不必要的65k方法限制.像(比如地图)这样的东西比上面的一般游戏服务用法更好:
implementation 'com.google.android.gms:play-services-maps:12.0.0'
Run Code Online (Sandbox Code Playgroud)
只需添加库引用,转到Propertes- > Android,然后添加库.

然后加入你 AndroidManifest.xml
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
184998 次 |
| 最近记录: |