[Dependency bug] Ads SDK 22.4.0 incompatible with CameraX

726 views
Skip to first unread message

Mikhail Gribanov

unread,
Sep 21, 2023, 6:16:11 AM9/21/23
to Google Mobile Ads SDK Developers
In my project I use CameraX:

    def camerax_version = "1.3.0-rc02"// same with 1.4.0-alpha01
    implementation "androidx.camera:camera-core:${camerax_version}"
    implementation "androidx.camera:camera-camera2:${camerax_version}"
    implementation "androidx.camera:camera-lifecycle:${camerax_version}"
    implementation "androidx.camera:camera-video:${camerax_version}"
    implementation "androidx.camera:camera-view:${camerax_version}"
    implementation "androidx.camera:camera-extensions:${camerax_version}"

Everything works with Ads 22.4.0:

    implementation 'com.google.android.gms:play-services-ads:22.3.0'
    implementation 'com.google.firebase:firebase-ads:22.3.0'

But after updating Ads to 22.4.0 (play-services-ads or firebase-ads) I get an error when building the app:

"Cannot access class 'com.google.common.util.concurrent.ListenableFuture'. Check your module classpath for missing or conflicting dependencies"

when I use basic CameraX functions (for example "camera.cameraControl.enableTorch(true)".

After a little googling it helped me to manually add the missing dependency:

    implementation "com.google.guava:guava:31.0.1-android"

It looks like the new version of the Ads SDK (22.4.0) has a dependency bug that makes it incompatible with CameraX out of the box.

Please pass this information to the developers.

Mobile Ads SDK Forum Advisor

unread,
Sep 27, 2023, 5:51:23 AM9/27/23
to mikhail....@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for contacting the Mobile Ads SDK Support team.

Upon reviewing your concern, I understand that you are facing an issue with cameraX while adding the Ads SDK and I see that you have resolved the issue.

Thank you for sharing the feedback with us.

Please reach out to us, if you need any further assistance.

This message is in relation to case "ref:_00D1U1174p._5004Q2p05rI:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


markus.w...@gmail.com

unread,
Nov 11, 2023, 8:12:04 AM11/11/23
to Google Mobile Ads SDK Developers
Same issue here.

Starting with version 22.4.0 the AdMob SDK seems to depend on Guava. Guava adds a transient dependency on com.google.guava:listenablefuture version 9999.0-empty-to-avoid-conflict-with-guava.

These versions end up in the project's classpath, which breaks CameraX because it doesn't contain a definition for the ListenableFuture interface.

Manually adding a dependency on Guava indeed seems to solve the problem but that is a workaround, not a solution!

So please, as OP said, pass this information to the developers. The issue is not resolved!

Mobile Ads SDK Forum Advisor

unread,
Nov 14, 2023, 12:59:42 AM11/14/23
to markus.w...@gmail.com, google-adm...@googlegroups.com

Hi Markus,

Thank you for contacting the Mobile Ads SDK support team.

After reviewing your concern, I understand that you have an issue with ads sdk 22.4.0 is incompatible with Camerax

Kindly share the below information privately for further investigation:

  • app ID
  • ad unit ID
  • Platform being used
  • Any specific Device issue occurs on
  • Steps to reproduce
  • Sample app reproducing the issue

You can provide the following details via reply privately to the author option or directly provide it to the link below.

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002qBniSQAS&entry.80707362=00210222

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

This message is in relation to case "ref:!00D1U01174p.!5004Q02qBniS:ref"


Thanks,
 
Google Logo Mobile Ads SDK Team


Reply all
Reply to author
Forward
0 new messages