- isGooglePlayServicesAvailable for Android? Or an Android 5.0 (Lollipop) issue? #1
- Comments
- Astrovic commented Feb 9, 2015
- AppWerft commented Jul 22, 2015
- ingo commented Jul 22, 2015
- AppWerft commented Jul 22, 2015
- Anonymize IP
- trueflywood commented Oct 22, 2015
- Когда isGooglePlayServicesAvailable возвращает SERVICE_VERSION_UPDATE_REQUIRED?
- 5 ответов
- Set up Google Play services
- Declare dependencies for Google Play services
- Check whether Google Play services is installed
- Google Play services dependencies
- Gradle plugins
isGooglePlayServicesAvailable for Android? Or an Android 5.0 (Lollipop) issue? #1
Comments
Astrovic commented Feb 9, 2015
Would need a way to check whether Google Play Services is available on the device, like this:
When it is not available, I get this error:
[ERROR] : TiApplication: (GAThread) [4865,5095] Sending event: exception on thread: GAThread msg:java.lang.IllegalArgumentException: Service Intent must be explicit: Intent < act=com.google.android.gms.analytics.service.START (has extras) >; Titanium 3.5.0,2015/01/12 15:33,0014f83
[ERROR] : TiApplication: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent < act=com.google.android.gms.analytics.service.START (has extras) >
[ERROR] : TiApplication: at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1682)
[ERROR] : TiApplication: at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1781)
[ERROR] : TiApplication: at android.app.ContextImpl.bindService(ContextImpl.java:1759)
[ERROR] : TiApplication: at android.content.ContextWrapper.bindService(ContextWrapper.java:538)
[ERROR] : TiApplication: at com.google.analytics.tracking.android.AnalyticsGmsCoreClient.connect(AnalyticsGmsCoreClient.java:82)
[ERROR] : TiApplication: at com.google.analytics.tracking.android.GAServiceProxy.connectToService(GAServiceProxy.java:330)
[ERROR] : TiApplication: at com.google.analytics.tracking.android.GAServiceProxy.createService(GAServiceProxy.java:210)
[ERROR] : TiApplication: at com.google.analytics.tracking.android.GAThread.init(GAThread.java:85)
[ERROR] : TiApplication: at com.google.analytics.tracking.android.GAThread.run(GAThread.java:352)
The text was updated successfully, but these errors were encountered:
AppWerft commented Jul 22, 2015
Hi Ingo,
we are in germany and in this country we need the property
‘[tracker set:kGAIAnonymizeIp value:@»1″];’
ingo commented Jul 22, 2015
Hi Rainer—can you explain in more detail?
AppWerft commented Jul 22, 2015
Anonymize IP
Enabling anonymize IP functionality tells Google Analytics to anonymize the IP information sent by the SDK by removing the last octet of the IP address prior to its storage.
The following example shows how to enable the anonymize IP functionality for a tracker:
[tracker set:kGAIAnonymizeIp value:@»1″];
Anonymize IP functionality can be set at any time.
.
With android I see a similar problem 😉
trueflywood commented Oct 22, 2015
I am getting this error on Android 5.0.1 (API 21) and 5.1.1 (API 22) but that is working with Android 4.4.4 (API 19)
Do you have any idea?
Источник
Когда isGooglePlayServicesAvailable возвращает SERVICE_VERSION_UPDATE_REQUIRED?
Означает ли это, что в магазине игр появилась новая версия сервисов Google Play?
Означает ли это, что приложению требуется более новая версия, чем та, которая сейчас установлена на устройстве?
Как проходит эта проверка?
5 ответов
Документация обновилась, теперь понятно:
Проверяет, что сервисы Google Play установлены и включены на этом устройство, и что версия, установленная на этом устройстве, не старше тот, который требуется этому клиенту .
Обратите внимание, что все текущие ответы ссылаются на GooglePlayServicesUtil, который теперь устарел. См. GooglePlayServicesUtil vs GoogleApiAvailability для получения подробной информации о том, как выполнить проверку совместимости версий сервисов Google Play.
Означает ли это, что в магазине игр появилась новая версия сервисов google play?
На сайте последнее обновление было декабрь 2014 г.
Означает ли это, что приложению требуется более новая версия, чем та, которая сейчас установлена на устройстве?
Вы можете проверить, установлена ли на устройстве более поздняя версия Google Play Service , чем версия в вашем приложении, вот так:
Вот где они говорят о том, чтобы «убедиться», что он установлен пользователем: https://developer.android.com/google/play-services/setup.html#ensure.
Это взято из официального исходного кода Iosched 2014 здесь:
Это означает, что версия службы Google Play, которую вы включили в свое приложение, выше, чем версия, установленная в настоящее время на устройстве пользователя. пользователю необходимо обновить свои сервисы Google Play, чтобы ваше приложение работало правильно.
Если результат возвращается с этой ошибкой, вы можете просто вызвать этот метод, чтобы предупредить пользователя, что им нужно обновить, и он доставит их туда.
result является результатом метода isGooglePlayServicesAvailable
Источник
Set up Google Play services
To develop an app using Google Play services APIs, follow the instructions on this page to set up your project with the relevant SDKs, which are available from the Google maven repository.
To test your app when using Google Play services, you must use one of the following:
- A compatible Android device that runs Android 4.4 (API level 19) or higher and has the Google Play Store app installed.
- The Android emulator with an AVD that runs the Google APIs platform based on Android 4.4 (API level 19) or higher.
Declare dependencies for Google Play services
To develop features that depend on the Google Play services APIs in your app, complete the following steps:
Open the build.gradle file inside your app’s module directory.
For each SDK that your app requires, include the dependency for that SDK. This page includes a section that lists common Google Play services dependencies for Android apps. You might also want to add Firebase dependencies to your project.
Save the changes and sync your project.
The following snippet shows an example build.gradle file that uses the location library:
New versions of the Google Play services SDKs with bug fixes and new features are periodically released. These updates are announced in the release notes. If your app uses a dependency that has been updated, change to the latest version in your app’s dependencies to take advantage of these fixes.
Check whether Google Play services is installed
As described in the Google Play services overview, Google Play services receives automatic updates on Android 4.4 (API level 19) and higher through the Google Play Store app. However, Android devices without Google Play Store don’t have Google Play services installed. If your app runs on devices without Google Play services, you might want to check to see if Google Play services is installed on the device before you attempt to use Google APIs, or enable features in your app that require Google Play services to function.
To check for the presence of Google Play services on the device, use the isGooglePlayServicesAvailable() method.
To then begin a connection to Google Play services, or learn how to detect whether the version of Google Play services installed supports a specific API, read the guide on Accessing Google APIs.
Google Play services dependencies
The following table lists the dependencies for Google Play services that you can include in your Android app. You can filter the list by device type by selecting one of the buttons, and you can search for a specific use case or dependency name by entering text into the box that appears after the buttons.
Phones and Tablets Android TV Auto Android Go Chrome OS Wear OS
Use case and dependency name | Supported devices |
---|---|
Google Mobile Ads com.google.android.gms:play-services-ads:20.5.0 | Phone, Tablet |
Android Advertising ID (AAID) com.google.android.gms:play-services-ads-identifier:17.1.0 | Phone, Tablet, Android TV, Chrome OS |
Lightweight version of Google Mobile Ads com.google.android.gms:play-services-ads-lite:20.5.0 | Phone, Tablet |
AdSense for Search (AFS) Custom Search Ads (CSA) com.google.android.gms:play-services-afs-native:19.0.1 | Phone, Tablet, Chrome OS |
Google Analytics Services SDK for Android com.google.android.gms:play-services-analytics:17.0.1 | Deprecated. Use Google Analytics for Firebase instead. |
Android App Set ID com.google.android.gms:play-services-appset:16.0.0 | Phone, Tablet, Android TV, Chrome OS |
Google Sign-In for Android com.google.android.gms:play-services-auth:19.2.0 | Phone, Tablet, Android TV, Auto, Android Go, Chrome OS |
SMS Retriever API com.google.android.gms:play-services-auth-api-phone:17.5.1 | Phone, Tablet, Android Go |
Block Store API (includes user credential storage) com.google.android.gms:play-services-auth-blockstore:16.0.2 | Phone, Tablet, Android Go, Chrome OS |
Google Awareness API com.google.android.gms:play-services-awareness:18.0.2 | Phone, Tablet, Auto, Android Go, Chrome OS |
Utility classes com.google.android.gms:play-services-base:17.6.0 | Phone, Tablet, Android TV, Auto, Android Go, Chrome OS, Wear OS |
More utility classes com.google.android.gms:play-services-basement:17.6.0 | Phone, Tablet, Android TV, Auto, Android Go, Chrome OS, Wear OS |
Google Cast com.google.android.gms:play-services-cast:20.1.0 | Phone, Tablet, Android Go, Chrome OS |
Google Cast Application Framework (CAF) com.google.android.gms:play-services-cast-framework:20.1.0 | Phone, Tablet, Android Go, Chrome OS |
Chromium network stack (Cronet) com.google.android.gms:play-services-cronet:17.0.1 | Phone, Tablet, Android TV, Auto, Android Go, Chrome OS, Wear OS |
Fast IDentity Online (FIDO) Authentication com.google.android.gms:play-services-fido:19.0.0-beta | Phone, Tablet, Android TV, Auto, Android Go, Chrome OS, Wear OS |
Supported on devices that run Android 7.0 (API level 24) or higher.
com.google.android.gms:play-services-fitness:20.0.0
com.google.android.gms:play-services-games:21.0.0
com.google.android.gms:play-services-instantapps:17.0.1
Supported on devices that run Android 5.0 (API level 21) or higher.
com.google.android.gms:play-services-location:18.0.0
com.google.android.gms:play-services-maps:18.0.0
com.google.android.gms:play-services-mlkit-barcode-scanning:16.2.1
com.google.android.gms:play-services-mlkit-face-detection:16.2.0
com.google.android.gms:play-services-mlkit-image-labeling:16.0.5
com.google.android.gms:play-services-mlkit-image-labeling-custom:16.0.0-beta1
com.google.android.gms:play-services-mlkit-language-id:16.0.0-beta2
com.google.android.gms:play-services-mlkit-text-recognition:17.0.0
com.google.android.gms:play-services-nearby:18.0.0
com.google.android.gms:play-services-oss-licenses:17.0.0
Supported on devices that run Android 5.0 (API level 21) or higher.
com.google.android.gms:play-services-password-complexity:17.0.1
Supported on devices that run Android 4.4 (API level 19) to Android 9 (API level 28).
com.google.android.gms:play-services-pay:16.0.1
Supported on devices that run Android 5.0 (API level 20) or higher.
com.google.android.gms:play-services-recaptcha:16.0.1
com.google.android.gms:play-services-safetynet:17.0.1
com.google.android.gms:play-services-tagmanager:17.0.1
com.google.android.gms:play-services-tasks:17.2.1
com.google.android.gms:play-services-vision:20.1.3
com.google.android.gms:play-services-wallet:18.1.3
com.google.android.gms:play-services-wearable:17.1.0
Gradle plugins
Google Play services also includes several Gradle plugins, as shown in the following table. Note that the buttons that appear before the previous table don’t change the information that appears in this table.
Use case and Gradle plugin name | Supported devices |
---|---|
Show open-source licenses com.google.android.gms:oss-licenses-plugin:0.10.4 | Phone, Tablet, Chrome OS |
Strict version checking com.google.android.gms:strict-version-matcher-plugin:1.2.2 | Phone, Tablet, Android TV, Auto, Android Go, Chrome OS, Wear OS |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Источник