Closed guybashan closed 9 months ago
I did notice that when calling it several times I get the following exception:
Failed while doing fetch and join (Ask Studio Bot)
android.os.LimitExceededException: API rate limit exceeded.
at android.adservices.common.AdServicesStatusUtils.asException(AdServicesStatusUtils.java:199)
at android.adservices.common.AdServicesStatusUtils.asException(AdServicesStatusUtils.java:210)
at android.adservices.customaudience.CustomAudienceManager$2.lambda$onFailure$1(CustomAudienceManager.java:255)
at android.adservices.customaudience.CustomAudienceManager$2$$ExternalSyntheticLambda1.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
So I was wondering, maybe the request is only queued for later usage? If YES, do I have a way of sending it ASAP?
I did a single call to the function, then after almost 30 seconds I noticed the log is filled with several exception of: IllegalStateException
Failed while doing fetch and join (Ask Studio Bot)
java.lang.IllegalStateException
at android.adservices.common.AdServicesStatusUtils.asException(AdServicesStatusUtils.java:203)
at android.adservices.common.AdServicesStatusUtils.asException(AdServicesStatusUtils.java:210)
at android.adservices.customaudience.CustomAudienceManager$2.lambda$onFailure$1(CustomAudienceManager.java:255)
at android.adservices.customaudience.CustomAudienceManager$2$$ExternalSyntheticLambda1.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
2023-10-18 17:25:47.079 10407-10554 MainActivity com.youappi.dsp.protectedaudience E Error when fetching audience (Ask Studio Bot)
java.lang.IllegalStateException
at android.adservices.common.AdServicesStatusUtils.asException(AdServicesStatusUtils.java:203)
at android.adservices.common.AdServicesStatusUtils.asException(AdServicesStatusUtils.java:210)
at android.adservices.customaudience.CustomAudienceManager$2.lambda$onFailure$1(CustomAudienceManager.java:255)
at android.adservices.customaudience.CustomAudienceManager$2$$ExternalSyntheticLambda1.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
2023-10-18 17:26:47.121 10407-10571 FetchAndJoin com.youappi.dsp.protectedaudience E Failed while doing fetch and join (Ask Studio Bot)
java.lang.IllegalStateException
at android.adservices.common.AdServicesStatusUtils.asException(AdServicesStatusUtils.java:203)
at android.adservices.common.AdServicesStatusUtils.asException(AdServicesStatusUtils.java:210)
at android.adservices.customaudience.CustomAudienceManager$2.lambda$onFailure$1(CustomAudienceManager.java:255)
at android.adservices.customaudience.CustomAudienceManager$2$$ExternalSyntheticLambda1.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
2023-10-18 17:26:47.123 10407-10572 MainActivity com.youappi.dsp.protectedaudience E Error when fetching audience (Ask Studio Bot)
java.lang.IllegalStateException
at android.adservices.common.AdServicesStatusUtils.asException(AdServicesStatusUtils.java:203)
at android.adservices.common.AdServicesStatusUtils.asException(AdServicesStatusUtils.java:210)
at android.adservices.customaudience.CustomAudienceManager$2.lambda$onFailure$1(CustomAudienceManager.java:255)
at android.adservices.customaudience.CustomAudienceManager$2$$ExternalSyntheticLambda1.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
This problem is no longer an issue as for the latest Canary release on Android Studio and working with the latest Android images.
I am trying to test the fetchAndJoinCustomAudience function.
After overcoming as sort of obstacles, the function seems to be properly called without any exception, but also without doing anything and ignoring the OutcomeReceiver I assigned to it. I did all the detailed steps in the documents. This is the code I am trying to run: