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

NoSuchMethodError: android.adservices.customaudience.CustomAudienceManager.<init>(android.content.Context) after updating Facebook SDK to 18.0.X #1306

Open
5 tasks done
lonskiTomasz opened this issue Mar 4, 2025 · 0 comments

Comments

@lonskiTomasz
Copy link

Checklist before submitting a bug report

Java version

21

Android version

Not related

Android SDK version

18.0.X

Installation platform & version

Gradle (Android Gradle plugin 8.7.3)

Package

Core & AppEvents

Goals

  • Successfully run UI snapshot tests using Paparazzi after upgrading the Facebook Android SDK from 17.0.0 to 18.0.X.

Expected results

  • The SDK should not invoke CustomAudienceManager when running in a JVM-only environment like Paparazzi.

Actual results

  • The Facebook SDK attempts to instantiate CustomAudienceManager even when running in a JVM-based test environment, causing NoSuchMethodError.
  • This issue did not occur in v17.0.0, but appeared after upgrading to v18.0.X.

Steps to reproduce

  1. Upgrade Facebook SDK from 17.0.0 to 18.0.X
  2. Run UI snapshot tests using Paparazzi
  3. Observe the following crash:

Cannot invoke "java.util.List.get(int)" because the return value of "com.android.ide.common.rendering.api.RenderSession.getRootViews()" is null
java.lang.NullPointerException: Cannot invoke "java.util.List.get(int)" because the return value of "com.android.ide.common.rendering.api.RenderSession.getRootViews()" is null
at app.cash.paparazzi.PaparazziSdk.takeSnapshots(PaparazziSdk.kt:245)
at app.cash.paparazzi.PaparazziSdk.snapshot(PaparazziSdk.kt:178)
at app.cash.paparazzi.PaparazziSdk.snapshot$default(PaparazziSdk.kt:176)
at app.cash.paparazzi.PaparazziSdk.snapshot(PaparazziSdk.kt:173)
at app.cash.paparazzi.Paparazzi.snapshot(Paparazzi.kt:103)
at app.cash.paparazzi.Paparazzi.snapshot$default(Paparazzi.kt:100)

Code samples & details

// INSERT YOUR CODE HERE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant