根据Google Play服务的不同,推荐的做法是保持Android应用的最大后向兼容性?最大限度地提高Google Play服务的向后兼容性
使用过Android Studio开发人员实现文档表明对编译V5 + compile 'com.google.android.gms:play-services:5.+'
与我使用似乎最终使用的版本5208000.可用下载在这一点,我得到的错误和警告,同时测试应用程序返回:
W/GooglePlayServicesUtil Google Play services out of date. Requires 5208000 but found 5089036
E/GooglePlayServicesUtil GooglePlayServices not available due to error 2
但是,我对Google Play服务的依赖Admob似乎正常工作。如果您按照Google的建议致电isGooglePlayServicesAvailable()
和GooglePlayServicesUtil.getErrorDialog()
,系统会通知用户应用程序需要升级才能运行并发送到没有可用更新的商店。
在其他地方维护向后兼容性意味着编译支持您需要的功能的最早的API版本。所以,我想与V4 compile 'com.google.android.gms:play-services:4.+'
产生的另错误:
E/GooglePlayServicesUtil﹕ The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
搜索周围的结果表明是虚假报告,可以忽略不计。
如果我针对更新的API版本进行编译,并且它不存在于设备上,那么情况会起作用吗?或者我必须哄用户升级?针对较旧的API版本进行编译并假定事情与设备上运行的较新版本正确向后兼容是否更好?
感谢您的评论,他们重申我的理解。令人困惑的部分是Google文档为什么建议做一些不是最佳实践的事情,而且实际上存在问题。 – ertyu 2014-09-12 18:37:14