如何确定使用哪种版本的Google Play服务?

时间:2022-06-07 06:59:29

I am working on an Android application which supports Android version 14 and above. I have compiled my application against Android version 21. I have used Google Play Services 7.0.0. The application works fine on Android 21. But when I run the application on Android version 19, it throws the following exception

我正在开发支持Android 14及更高版本的Android应用程序。我已针对Android 21版编译了我的应用程序。我使用的是Google Play Services 7.0.0。该应用程序在Android 21上正常运行。但是当我在Android版本19上运行该应用程序时,它会抛出以下异常

Google Play services out of date. Requires 7095000 but found 6183036

Google Play服务已过期。需要7095000但找到6183036

So, I want to know what should be the version of Google Play that I should include in my application so that it works fine on Android 14 and above.

所以,我想知道应该在我的应用程序中包含哪些版本的Google Play,以便在Android 14及更高版本上正常运行。

2 个解决方案

#1


6  

I think you are trying to find an answer to your question using a wrong approach.

我想您正在尝试使用错误的方法找到问题的答案。

The version of the Google Play Services that you want to include depends on the APIs your application implements. Picking a version based on the device you want to support will affect your application performance in a negative way.

您要包含的Google Play服务版本取决于您的应用程序实现的API。根据您要支持的设备选择版本会以负面方式影响您的应用程序性能。

Nearby Connections API, Places API are added in the Google Play services 7.0. If your application is using any of those or other APIs added in this version of Play Services then, these features may not work if you specify a lesser version in the Gradle files.

附近的Connections API,Places API已添加到Google Play服务7.0中。如果您的应用程序正在使用此版本的Play服务中添加的任何API或其他API,那么如果您在Gradle文件中指定较小的版本,这些功能可能无效。

Similarly, Mobile Vision API, Nearby Messages were introduced in the Google Play Services version 7.8. There is no way you can implement them by including an earlier version of Play Services even if you want to support Android 2.3 devices.

同样,Mobile Vision API,Nearby Messages也是在Google Play Services 7.8版中引入的。即使您想支持Android 2.3设备,也无法通过包含早期版本的Play服务来实现它们。

Maps and Location Based Services services had been updated in many Play Services versions. Each update has added a small feature to it and improved overall battery efficiency, responsiveness. The version number you are using will affect the battery life ...

许多Play服务版本中的地图和基于位置的服务服务已更新。每次更新都为其增加了一个小功能,并提高了整体电池效率和响应能力。您使用的版本号将影响电池寿命...

In every update to the Google Play Services existing versions, new APIs are released and old ones are improved. Consider the APIs your application is implementing then decide which version of the Play Services you want your users to update so that they can use your application smoothly.

在Google Play Services现有版本的每次更新中,都会发布新API,并对旧版API进行改进。考虑您的应用程序正在实施的API,然后决定您希望用户更新哪个版本的Play服务,以便他们可以顺利使用您的应用程序。

Many Android users regularly update their Google Play Services. Even if the user has a KitKat device or Ice Cream Sandwich they could have updated their Google Play Services to the latest 7.8 version or to an intermediate version.

许多Android用户会定期更新其Google Play服务。即使用户有KitKat设备或Ice Cream Sandwich,他们也可以将他们的Google Play服务更新到最新的7.8版本或中间版本。

#2


-1  

You can change the minimum sdk version in gradle(app) file to run your application in lower versions of android.

您可以更改gradle(app)文件中的最小sdk版本,以在较低版本的android中运行您的应用程序。

#1


6  

I think you are trying to find an answer to your question using a wrong approach.

我想您正在尝试使用错误的方法找到问题的答案。

The version of the Google Play Services that you want to include depends on the APIs your application implements. Picking a version based on the device you want to support will affect your application performance in a negative way.

您要包含的Google Play服务版本取决于您的应用程序实现的API。根据您要支持的设备选择版本会以负面方式影响您的应用程序性能。

Nearby Connections API, Places API are added in the Google Play services 7.0. If your application is using any of those or other APIs added in this version of Play Services then, these features may not work if you specify a lesser version in the Gradle files.

附近的Connections API,Places API已添加到Google Play服务7.0中。如果您的应用程序正在使用此版本的Play服务中添加的任何API或其他API,那么如果您在Gradle文件中指定较小的版本,这些功能可能无效。

Similarly, Mobile Vision API, Nearby Messages were introduced in the Google Play Services version 7.8. There is no way you can implement them by including an earlier version of Play Services even if you want to support Android 2.3 devices.

同样,Mobile Vision API,Nearby Messages也是在Google Play Services 7.8版中引入的。即使您想支持Android 2.3设备,也无法通过包含早期版本的Play服务来实现它们。

Maps and Location Based Services services had been updated in many Play Services versions. Each update has added a small feature to it and improved overall battery efficiency, responsiveness. The version number you are using will affect the battery life ...

许多Play服务版本中的地图和基于位置的服务服务已更新。每次更新都为其增加了一个小功能,并提高了整体电池效率和响应能力。您使用的版本号将影响电池寿命...

In every update to the Google Play Services existing versions, new APIs are released and old ones are improved. Consider the APIs your application is implementing then decide which version of the Play Services you want your users to update so that they can use your application smoothly.

在Google Play Services现有版本的每次更新中,都会发布新API,并对旧版API进行改进。考虑您的应用程序正在实施的API,然后决定您希望用户更新哪个版本的Play服务,以便他们可以顺利使用您的应用程序。

Many Android users regularly update their Google Play Services. Even if the user has a KitKat device or Ice Cream Sandwich they could have updated their Google Play Services to the latest 7.8 version or to an intermediate version.

许多Android用户会定期更新其Google Play服务。即使用户有KitKat设备或Ice Cream Sandwich,他们也可以将他们的Google Play服务更新到最新的7.8版本或中间版本。

#2


-1  

You can change the minimum sdk version in gradle(app) file to run your application in lower versions of android.

您可以更改gradle(app)文件中的最小sdk版本,以在较低版本的android中运行您的应用程序。