如何抑制“避免使用捆绑版本的 Google Play 服务 SDK"警告? [英] How to suppress the "Avoid using bundled version of Google Play services SDK" warning?
问题描述
我在我的 Android 应用程序中使用 Google Play 服务,所以我在我的 build.gradle
中有依赖项.
I'm using the Google Play services in my Android app so I have the dependency in my build.gradle
.
compile 'com.google.android.gms:play-services:10.2.1'
但 Android Studio 显示了一个警告:避免使用捆绑版本的 Google Play 服务 SDK
.
But Android Studio shows a warning for it: Avoid using bundled version of Google Play services SDK
.
这个警告是什么意思?我应该如何避免它?我在谷歌上搜索了很多没有找到太多相关信息.
What does this warning mean? How should I avoid it? I've googled a lot without finding much related info.
推荐答案
在 6.5 之前的 Google Play 服务版本中,您必须将整个 API 包编译到您的应用中.在某些情况下,这样做会使您的应用程序中的方法(包括框架 API、库方法和您自己的代码)的数量保持在 65,536 个限制以下变得更加困难.从 6.5 版开始,您可以有选择地将 Google Play 服务 API 编译到您的应用中
In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs into your app. In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit. From version 6.5, you can instead selectively compile Google Play service APIs into your app
inside compile com.google.android.gms:play-services:12.0.0
包含很多依赖项.. 见下文.. 使用 play-services 可能会导致 dex 问题和繁重的应用程序.仅选择您真正依赖的目标:)
inside compile com.google.android.gms:play-services:12.0.0
contains alot of dependencies.. see below.. using play-services may cause dex problem and heavy app. Select only which want do you really depends to :)
Google Play services API Description in build.gradle
Google+ com.google.android.gms:play-services-plus:12.0.0
Google Account Login com.google.android.gms:play-services-auth:12.0.0
Google Actions,
Base Client Library com.google.android.gms:play-services-base:12.0.0
Google Address API com.google.android.gms:play-services-identity:12.0.0
Google Analytics com.google.android.gms:play-services-analytics:12.0.0
Google Awareness com.google.android.gms:play-services-awareness:12.0.0
Google Cast com.google.android.gms:play-services-cast:12.0.0
Google Cloud Messaging com.google.android.gms:play-services-gcm:12.0.0
Google Drive com.google.android.gms:play-services-drive:12.0.0
Google Fit com.google.android.gms:play-services-fitness:12.0.0
Google Location and
Activity Recognition com.google.android.gms:play-services-location:12.0.0
Google Maps com.google.android.gms:play-services-maps:12.0.0
Google Mobile Ads com.google.android.gms:play-services-ads:12.0.0
Google Places com.google.android.gms:play-services-places:12.0.0
Mobile Vision com.google.android.gms:play-services-vision:12.0.0
Google Nearby com.google.android.gms:play-services-nearby:12.0.0
Google Panorama Viewer com.google.android.gms:play-services-panorama:12.0.0
Google Play Game com.google.android.gms:play-services-games:12.0.0
SafetyNet com.google.android.gms:play-services-safetynet:12.0.0
Android Pay com.google.android.gms:play-services-wallet:12.0.0
Android Wear com.google.android.gms:play-services-wearable:12.0.0
Firebase
Firebase API Description in build.gradle
Analytics com.google.firebase:firebase-core:12.0.0
Realtime Database com.google.firebase:firebase-database:12.0.0
Cloud Firestore com.google.firebase:firebase-firestore:12.0.0
Storage com.google.firebase:firebase-storage:12.0.0
Crash Reporting com.google.firebase:firebase-crash:12.0.0
Authentication com.google.firebase:firebase-auth:12.0.0
Cloud Messaging com.google.firebase:firebase-messaging:12.0.0
Remote Config com.google.firebase:firebase-config:12.0.0
Invites and
Dynamic Links com.google.firebase:firebase-invites:12.0.0
AdMob com.google.firebase:firebase-ads:12.0.0
App Indexing com.google.firebase:firebase-appindexing:12.0.0
Performance Monitoring com.google.firebase:firebase-perf:12.0.0
编辑以上版本已被弃用.他们使用单独的版本控制.请参考下面的链接
Google Play 服务 - https://developers.google.com/android/guides/setup
Firebase - https://firebase.google.com/docs/android/setup
EDIT
Above version is already deprecated. They use individual versioning. Please refer Link Below
Google Play Service - https://developers.google.com/android/guides/setup
Firebase - https://firebase.google.com/docs/android/setup
这篇关于如何抑制“避免使用捆绑版本的 Google Play 服务 SDK"警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!