Android – Why Google play services dependency automatically added _GET_INSTALL_REFERRER_SERVICE permission

Won’t Fix (Intended behavior)

Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not allowed to bind to service Intent (com.google.android.finsky.BIND_GET_INSTALL_REFERRER_SERVICE) #8830

jkmassel opened this issue Dec 19, 2018 · 3 comments

Not allowed to bind to service Intent (com.google.android.finsky.BIND_GET_INSTALL_REFERRER_SERVICE) #8830

jkmassel opened this issue Dec 19, 2018 · 3 comments

Comments

Contributor
jkmassel commented Dec 19, 2018 •

It seems that in many cases, we’re not able to use Google’s download attribution.

We’re not crashing because of it – but we are handling a java.lang.SecurityException thrown from

Stack trace:

Non-fatal Exception: java.lang.SecurityException: Not allowed to bind to service Intent < act=com.google.android.finsky.BIND_GET_INSTALL_REFERRER_SERVICE cmp=com.android.vending/com.google.android.finsky.externalreferrer.GetInstallReferrerService >at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1480) at android.app.ContextImpl.bindService(ContextImpl.java:1434) at android.content.ContextWrapper.bindService(ContextWrapper.java:636) at com.android.installreferrer.api.InstallReferrerClientImpl.startConnection(InstallReferrerClientImpl.java:135) at org.wordpress.android.util.analytics.service.InstallationReferrerServiceLogic.performTask(InstallationReferrerServiceLogic.java:120) at org.wordpress.android.util.analytics.service.InstallationReferrerService.onStartCommand(InstallationReferrerService.java:48) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3394) at android.app.ActivityThread.-wrap21(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1632) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6284) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1094) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955) 

It appears all that’s required to fix this is the addition of the com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE permission, but that may or may not be something we want to add to the bundle?
(source: https://stackoverflow.com/questions/47706419/installreferrerclient-startconnection-throwing-error)

reference: 5bab95e3f8b88c29636353be-fabric
impact: we’re not able to receive in-app attribution for downloads

The text was updated successfully, but these errors were encountered:

Android – Why Google play services dependency automatically added com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE permission

Recently i have updated google play services dependency version to 15.0.0 it automatically added the below permission.

i don’t no wheather i need this Google Play Referrer API permission or not

I’m able to remove this permission

but i need know which dependency will need BIND_GET_INSTALL_REFERRER_SERVICE permission does the dependency really need this permission or not.

App Level Gradle

dependencies < ext < support_library_version = '27.0.2' google_play_services_version = '15.0.0' >implementation 'com.android.support:multidex:1.0.3' implementation "com.android.support:appcompat-v7:$" implementation "com.android.support:design:$" implementation "com.android.support:recyclerview-v7:$" implementation "com.android.support:cardview-v7:$" implementation "com.google.android.gms:play-services-analytics:$" implementation "com.google.android.gms:play-services-gcm:$" implementation "com.google.firebase:firebase-messaging:$" implementation "com.google.firebase:firebase-core:$" implementation "com.google.firebase:firebase-ads:$" > 

Project Level Gradle

dependencies

Note: For referrer tracking am already using google analytics

Best Solution

Won’t Fix (Intended behavior)

For More details check Google Issue Tracker

Related Solutions

Android – How to install Google Play Services in a Genymotion VM (with no drag and drop support)

As of Genymotion 2.10.0 and onwards, GApps can be installed from the emulator toolbar. Please refer to answer by @MichaelStoddart.

Next follows former answer kept here for historic reason:

Genymotion doesn’t provide Google Apps. To install Google Apps:

  1. Upgrade Genymotion and VirtualBox to the latest version.
  2. Download two zip files:
    – ARM Translation Installer v1.1
    Google Apps for your Android version: 2.3.7 – 4.4.4 or 4.4 – 6.0 (with platform and variant) You can also find the GApps list in the wbroek user GitHubGist page.
  3. Open Genymotion emulator and go to home screen then drag and drop the first file Genymotion-ARM-Translation_v1.1.zip over the emulator. A dialog will appear and show as file transfer in progress, then another dialog will appear and ask that do you want to flash it on the emulator. Click OK and reboot the device by running adb reboot from your terminal or command prompt.
  4. Drag and drop the second file gapps-*-signed.zip and repeat the same steps as above. Run adb reboot again and, once rebooted, Google Apps will be in the emulator.
  5. At this point ‘Google Apps Services’ will crash frequently with the following message google play services has stopped working . Open Google Play. After providing your account details, open Google Play and update your installed Google Apps. This seems to make Google Play realize you have an old Google Play Services and will ask you to update (in my case, updating Google Hangouts required a new version of Google Play Services). I’ve also heard that simply waiting will also prompt you to update. The ‘Google Play Services’ app doesn’t seem to appear otherwise – you can’t search for it. You should then see an offer to update Google Play Services. Once the new Google Play Services is installed you will now have stable, working access to Google Play
Android – In project ‘app’ a resolved Google Play services library dependency depends on another at an exact version

There are many answers here for individual solutions that do not really get down to the problem. Here is how to solve this in general:

As the original log output suggests, it is useful to run the build in the terminal with the following command:

./gradlew –info assembleDebug

This will give you a list of all dependencies that are involved in the conflict. It looks similar to this (I removed the package name stuff to make it a bit more readable):

Dependency Resolution Help: Displaying all currently known paths to any version of the dependency: Artifact(groupId=com.google.firebase, artifactId=firebase-iid) -- task/module dep -> [email protected] ---- firebase-analytics:17.2.0 library depends -> [email protected] ------ play-services-measurement-api:17.2.0 library depends -> [email protected] -- task/module dep -> [email protected] ---- firebase-core:17.2.0 library depends -> [email protected] ------ firebase-analytics:17.2.0 library depends -> [email protected] -------- play-services-measurement-api:17.2.0 library depends -> [email protected] -- task/module dep -> [email protected] ---- play-services-measurement-api:17.2.0 library depends -> [email protected] -- task/module dep -> [email protected] -- task/module dep -> [email protected] ---- firebase-messaging:17.1.0 library depends -> firebase-iid@[16.2.0] -- task/module dep -> com.pressenger:[email protected] ---- com.pressenger:sdk:4.8.0 library depends -> [email protected] ------ firebase-messaging:17.1.0 library depends -> firebase-iid@[16.2.0] 

From this list you get to know 2 things:

  1. Where is the conflicting depedency found
  2. What versions of the conflicting dependency are set up

In my case the conflicting dependency is firebase-iid : It’s either @19.0.0 or @16.2.0

To fix this you must define the top-level dependency of the wrong firebase-iid explicitly in your build.gralde .

So in the upper log you can see that there are 2 examples of an out-dated version of [email protected]. One comes from — task/module dep -> [email protected] the other one from a third-party library (pressenger). We don’t have influence on the third-party library, so nothing to do here. But for the other dependency, we have to declare it explicitly with the correct version:

Now the build works again. Happy ending 🙂