简体   繁体   English

我可以在使用gradle时从AndroidManifest中删除com.google.android.gms.version吗?

[英]Can I remove com.google.android.gms.version from AndroidManifest when I use gradle?

I wonder if I can remove this line safely: 我想知道我是否可以安全地删除此行:

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

from my AndroidManifest.xml when I use gradle to build my APK. 当我使用gradle构建我的APK时,从我的AndroidManifest.xml。

According to the website https://developers.google.com/android/guides/setup only when I choose "ECLIPSE WITH ADT" I have to add this line. 根据网站https://developers.google.com/android/guides/setup,只有当我选择“ECLIPSE WITH ADT”时,我必须添加此行。 For "ANDROID STUDIO" usage this is not mentioned. 对于“ANDROID STUDIO”用法,没有提及。

But in my case I use Eclipse (with ADT) as IDE but I build with gradle. 但在我的情况下,我使用Eclipse(使用ADT)作为IDE,但我使用gradle构建。 (Actually it is a libGDX project). (实际上它是一个libGDX项目)。 So I added the play-services by using gradle: 所以我使用gradle添加了play-services:

compile "com.google.android.gms:play-services:8.1.0"

So I run the app on a test device and I tested to login with play-services and it worked fine without having the line above in my AndroidManifest.xml 所以我在测试设备上运行应用程序,我测试了使用play-services登录,并且在我的AndroidManifest.xml中没有上面的行就可以正常工作

But, maybe the login just does not need the "com.google.android.gms.version" value and another part of the play services lib needs it? 但是,也许登录只是不需要“com.google.android.gms.version”值而播放服务lib的另一部分需要它吗? But I cannot test all the possible ways to use the lib. 但我无法测试使用lib的所有可能方法。

Does anybody know for sure? 有人知道吗?

Or for those of you who use Android Studio + play services: Does your AndroidManifest.xml have the line above? 或者对于那些使用Android Studio +播放服务的人:您的AndroidManifest.xml是否具有以上行?

是的,从Google Play服务7.0开始 (在7.5中改进以消除对应用于完整play-services依赖性的限制), <meta-data>标记由Gradle通过清单合并自动添加到您的清单文件中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 什么是com.google.android.gms.version? - What is com.google.android.gms.version? 我可以删除吗<meta-data android:name="com.google.android.gms.version" ..."/>当我升级到 play-services-ads:17.0.0 时? - Can I delete <meta-data android:name="com.google.android.gms.version" ..."/> when I upgrade to play-services-ads:17.0.0? 没有资源与com.google.android.gms.version匹配 - No resource matches com.google.android.gms.version 当我添加编译&#39;com.google.android.gms:play-services-wearable:6.5.87&#39;时,gradle构建失败 - My gradle build fails when I add compile 'com.google.android.gms:play-services-wearable:6.5.87' 如何使用Gradle构建在Android Studio中导入com.google.android.gms。*? - How do I import com.google.android.gms.* in Android Studio using a Gradle build? Gradle无法解析com.google.android.gms.analytics.Tracker - Gradle can not resolve com.google.android.gms.analytics.Tracker com.google.android.gms 版本不匹配 - com.google.android.gms version mismatch 如何触发 com.google.android.gms.actions.SEARCH_ACTION Google Now 操作进行测试? - How can I trigger the com.google.android.gms.actions.SEARCH_ACTION Google Now action for testing? 使用“com.google.android.gms.maps.GoogleMap”,我可以像在 maps.google.com 上一样绘制路线吗? - Using “com.google.android.gms.maps.GoogleMap”, can I draw a route as I can on maps.google.com? 如何在Android应用程序com.google.android.gms.maps.GoogleMap中导入此程序包(库) - how can i import this packages (Libraries) in my android application com.google.android.gms.maps.GoogleMap
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM