Skip to content
New issue

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

Adjust + Amplitude broken on Android #101

Open
vishna opened this issue Apr 19, 2022 · 1 comment
Open

Adjust + Amplitude broken on Android #101

vishna opened this issue Apr 19, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@vishna
Copy link
Contributor

vishna commented Apr 19, 2022

Expected Behavior

[adjust] Install is displayed on Android & iOS

Current Behavior

[adjust] Install is only displayed on iOS

Possible Solution

The root of the problem is Android Amplitude SDK, logs show:

W/com.amplitude.api.DeviceInfo( 3416): Google Play Services not available for advertising id
W/com.amplitude.api.DeviceInfo( 3416): Google Play Services SDK not found for app set id!

Seems like class com.google.android.gms.ads.identifier.AdvertisingIdClient is not getting found in DeviceInfo.java

Followed all the instructions regarding the gradle/proguard setup.

Someone suggested a fix (not using reflection), but afaik it got dismissed dantetam/Amplitude-Android@39c70ab due to "we would have to change our tests" 🤷‍♀️

Now Adjust SDK seems to find and assign advertising id on Android just fine. My fix introduces option to set custom advertising id, this involves changes in both Android and Flutter repos:

Then I can simply use it at initialisation time and supply valid advertising id:

final amplitude = Amplitude.getInstance();
final adId = await Adjust.getGoogleAdId();
await amplitude.setCustomAdvertisingId(advertisingId);

This fixed problem we saw in our amplitude dashboard.

Steps to Reproduce

  1. Integrate Flutter Amplitude SDK
  2. Integrate Flutter Adjust SDK
  3. Publish your apps
  4. Observe Adjust install events are reported on iOS while not reported on Android

Environment

  • SDK Version: 3.8.1
  • Flutter Version: 2.10 stable
  • Device: any Android
  • Device OS and Version: any Android
@vishna vishna added the bug Something isn't working label Apr 19, 2022
@yuhao900914
Copy link
Contributor

Hi @vishna , thanks for contributing our SDKs, we have viewed your pr and left some comments there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants