在 Android Studio 上添加 Google Play 服务依赖项的最佳方法是什么?
What is the best way to add Google Play Service dependencies on Android Studio?
我已将 Google Play 服务依赖项添加到 Android Studio。
我想要在今天和不久的将来都能正常工作的东西,让我的应用程序代码保持最新的东西,而不必担心每个新的 Play 服务版本,如果可能的话。
目前,我有这个:
dependencies {
compile 'com.google.android.gms:play-services:7.5.0'
}
这是在 Android 上添加 Google Play 服务依赖项的最佳方式吗?
您可以使用以下内容始终针对最新可用的 Google Play 服务版本进行构建:
compile 'com.google.android.gms:play-services:+'
但是,您会收到来自 Android Studio 的警告,指出您的构建可能是不可重复的,并且您的代码可能随时因幕后更改版本而中断(您可能不知道为什么) .这是一个权衡。要获得更多控制,您可以使用其中之一:
compile 'com.google.android.gms:play-services:7.+'
compile 'com.google.android.gms:play-services:7.5.+'
我已将 Google Play 服务依赖项添加到 Android Studio。 我想要在今天和不久的将来都能正常工作的东西,让我的应用程序代码保持最新的东西,而不必担心每个新的 Play 服务版本,如果可能的话。
目前,我有这个:
dependencies {
compile 'com.google.android.gms:play-services:7.5.0'
}
这是在 Android 上添加 Google Play 服务依赖项的最佳方式吗?
您可以使用以下内容始终针对最新可用的 Google Play 服务版本进行构建:
compile 'com.google.android.gms:play-services:+'
但是,您会收到来自 Android Studio 的警告,指出您的构建可能是不可重复的,并且您的代码可能随时因幕后更改版本而中断(您可能不知道为什么) .这是一个权衡。要获得更多控制,您可以使用其中之一:
compile 'com.google.android.gms:play-services:7.+'
compile 'com.google.android.gms:play-services:7.5.+'