Unity Ads adapter broken

381 views
Skip to first unread message

Ed Marty

unread,
Jul 21, 2016, 1:44:48 PM7/21/16
to Google Mobile Ads SDK Developers
The Unity Ads adapter for AdMob Mediation Incentivized videos is broken.

I downloaded the adapter from https://dl.google.com/googleadmobadssdk/adapterunityandroid.zip. I had to decompile it to figure out it was the adapter that was at fault. The specific issue is this:

com.google.ads.mediation.unity.UnitySingleton declares mUnityAdsIntitializationState. It is initialized to 0 (STATE_NOT_INITIALIZED). It is set to 1 inside of initializeUnityAds() (STATE_INITIALIZING). Nowhere is it ever set to 2 (STATE_INITIALIZED). When loadAd() is called, it checks if it is equal to 2 before calling either listener.onFetchCompleted() or listener.onFetchFailed(). Since it is never set to 2, it sits forever, trying to load an ad as far as the caller is concerned. If I set mUnityAdsInitializationState = 2 manually in the debugger just before making that comparison, it works correctly, onFetchCompleted() is called, and the Unity Ad can display.

Ed Marty

unread,
Jul 21, 2016, 1:46:55 PM7/21/16
to Google Mobile Ads SDK Developers
I would include extra information such as various library and SDK versions, but they are not relevant to the issue, which is entirely localized within the adapter.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jul 21, 2016, 3:51:24 PM7/21/16
to Google Mobile Ads SDK Developers
Hi Ed,

Thank you for the feedback. I, however, would not be able talk about the internal workings of the SDK. 

Were you unable to load ads? I was able to load Unity Ads without any issue. Can you send us a stack trace or your sample app if you are having any issues?

Thanks,
Veer Busani
Mobile Ads SDK Team

Ed Marty

unread,
Jul 21, 2016, 4:17:06 PM7/21/16
to google-adm...@googlegroups.com
I can load ads using other ad network adapters just fine. There's only a problem with the Unity Ads network adapter as I outlined. If nobody can actually look at the adapter code and verify my claims, I guess I will try to get a sample app together.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0X02hppRJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Ed Marty
Senior Software Engineer
Concrete Software, Inc.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jul 21, 2016, 4:56:32 PM7/21/16
to Google Mobile Ads SDK Developers
Hi Ed,

Can you send me a sample app that would reproduce this issue? I will then be able to take it up with the team. 

Thanks,
Veer Busani
Mobile Ads SDK Team

On Thursday, July 21, 2016 at 4:17:06 PM UTC-4, Ed Marty wrote:
I can load ads using other ad network adapters just fine. There's only a problem with the Unity Ads network adapter as I outlined. If nobody can actually look at the adapter code and verify my claims, I guess I will try to get a sample app together.
On Thu, Jul 21, 2016 at 2:51 PM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-admob-ads-sdk@googlegroups.com> wrote:
Hi Ed,

Thank you for the feedback. I, however, would not be able talk about the internal workings of the SDK. 

Were you unable to load ads? I was able to load Unity Ads without any issue. Can you send us a stack trace or your sample app if you are having any issues?

Thanks,
Veer Busani
Mobile Ads SDK Team

On Thursday, July 21, 2016 at 1:46:55 PM UTC-4, Ed Marty wrote:
I would include extra information such as various library and SDK versions, but they are not relevant to the issue, which is entirely localized within the adapter.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0X02hppRJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ed Marty

unread,
Jul 22, 2016, 10:36:18 AM7/22/16
to google-adm...@googlegroups.com
Here's a sample apk that reproduces the issue.


On Thu, Jul 21, 2016 at 3:56 PM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-adm...@googlegroups.com> wrote:
Hi Ed,

Can you send me a sample app that would reproduce this issue? I will then be able to take it up with the team. 

Thanks,
Veer Busani
Mobile Ads SDK Team

On Thursday, July 21, 2016 at 4:17:06 PM UTC-4, Ed Marty wrote:
I can load ads using other ad network adapters just fine. There's only a problem with the Unity Ads network adapter as I outlined. If nobody can actually look at the adapter code and verify my claims, I guess I will try to get a sample app together.
On Thu, Jul 21, 2016 at 2:51 PM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-adm...@googlegroups.com> wrote:
Hi Ed,

Thank you for the feedback. I, however, would not be able talk about the internal workings of the SDK. 

Were you unable to load ads? I was able to load Unity Ads without any issue. Can you send us a stack trace or your sample app if you are having any issues?

Thanks,
Veer Busani
Mobile Ads SDK Team

On Thursday, July 21, 2016 at 1:46:55 PM UTC-4, Ed Marty wrote:
I would include extra information such as various library and SDK versions, but they are not relevant to the issue, which is entirely localized within the adapter.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0X02hppRJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Ed Marty
Senior Software Engineer
Concrete Software, Inc.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0X02hppRJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ed Marty

unread,
Jul 22, 2016, 11:00:21 AM7/22/16
to google-adm...@googlegroups.com

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jul 22, 2016, 5:10:12 PM7/22/16
to Google Mobile Ads SDK Developers
Hi Ed,

I'm unable to receive UnityAds from your Ad Unit ID. In any case, here is an Ad Unit ID: ca-app-pub-6745644712123529/5359080899 that you can try with this sample app. Let me know if that works for you. Have you created the unity-plugin-library.jar by yourself? I'm not sure why you have done that but in any case, the UnityAd framework give you aar and the project itself. You can copy that into Assets > Plugins > Android folder. 

Let me know if you need anything else.


Thanks,
Veer Busani
Mobile Ads SDK Team

On Friday, July 22, 2016 at 11:00:21 AM UTC-4, Ed Marty wrote:
On Fri, Jul 22, 2016 at 9:36 AM, Ed Marty <sma...@concretesoftware.com> wrote:
Here's a sample apk that reproduces the issue.

On Thu, Jul 21, 2016 at 3:56 PM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-admob-ads-sdk@googlegroups.com> wrote:
Hi Ed,

Can you send me a sample app that would reproduce this issue? I will then be able to take it up with the team. 

Thanks,
Veer Busani
Mobile Ads SDK Team

On Thursday, July 21, 2016 at 4:17:06 PM UTC-4, Ed Marty wrote:
I can load ads using other ad network adapters just fine. There's only a problem with the Unity Ads network adapter as I outlined. If nobody can actually look at the adapter code and verify my claims, I guess I will try to get a sample app together.
On Thu, Jul 21, 2016 at 2:51 PM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-admob-ads-sdk@googlegroups.com> wrote:
Hi Ed,

Thank you for the feedback. I, however, would not be able talk about the internal workings of the SDK. 

Were you unable to load ads? I was able to load Unity Ads without any issue. Can you send us a stack trace or your sample app if you are having any issues?

Thanks,
Veer Busani
Mobile Ads SDK Team

On Thursday, July 21, 2016 at 1:46:55 PM UTC-4, Ed Marty wrote:
I would include extra information such as various library and SDK versions, but they are not relevant to the issue, which is entirely localized within the adapter.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0X02hppRJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Ed Marty
Senior Software Engineer
Concrete Software, Inc.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0X02hppRJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Ed Marty
Senior Software Engineer
Concrete Software, Inc.

Ed Marty

unread,
Jul 22, 2016, 5:45:42 PM7/22/16
to google-adm...@googlegroups.com
No, I didn't create the unity-plugin-library.jar myself. I imported the Unity package downloaded from here:


I am using the Unity Ads service built into Unity, not any external library, which works fine when invoking them through C#, or if I hack around the broken adapter to tell it to display the ads anyway, using the Ad Unit ID in the example I provided.

Inline image 1

I don't have time to look at the sample just now, but I will try to get to it Monday to see if that solves the problem (but the UnityAdsAdapter.jar in the sample seems to have the same problem)

On Fri, Jul 22, 2016 at 4:10 PM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-adm...@googlegroups.com> wrote:
Hi Ed,

I'm unable to receive UnityAds from your Ad Unit ID. In any case, here is an Ad Unit ID: ca-app-pub-6745644712123529/5359080899 that you can try with this sample app. Let me know if that works for you. Have you created the unity-plugin-library.jar by yourself? I'm not sure why you have done that but in any case, the UnityAd framework give you aar and the project itself. You can copy that into Assets > Plugins > Android folder. 

Let me know if you need anything else.

Thanks,
Veer Busani
Mobile Ads SDK Team

On Friday, July 22, 2016 at 11:00:21 AM UTC-4, Ed Marty wrote:
On Fri, Jul 22, 2016 at 9:36 AM, Ed Marty <sma...@concretesoftware.com> wrote:
Here's a sample apk that reproduces the issue.

On Thu, Jul 21, 2016 at 3:56 PM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-adm...@googlegroups.com> wrote:
Hi Ed,

Can you send me a sample app that would reproduce this issue? I will then be able to take it up with the team. 

Thanks,
Veer Busani
Mobile Ads SDK Team

On Thursday, July 21, 2016 at 4:17:06 PM UTC-4, Ed Marty wrote:
I can load ads using other ad network adapters just fine. There's only a problem with the Unity Ads network adapter as I outlined. If nobody can actually look at the adapter code and verify my claims, I guess I will try to get a sample app together.
On Thu, Jul 21, 2016 at 2:51 PM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-adm...@googlegroups.com> wrote:
Hi Ed,

Thank you for the feedback. I, however, would not be able talk about the internal workings of the SDK. 

Were you unable to load ads? I was able to load Unity Ads without any issue. Can you send us a stack trace or your sample app if you are having any issues?

Thanks,
Veer Busani
Mobile Ads SDK Team

On Thursday, July 21, 2016 at 1:46:55 PM UTC-4, Ed Marty wrote:
I would include extra information such as various library and SDK versions, but they are not relevant to the issue, which is entirely localized within the adapter.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0X02hppRJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Ed Marty
Senior Software Engineer
Concrete Software, Inc.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0X02hppRJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Ed Marty
Senior Software Engineer
Concrete Software, Inc.



--
Ed Marty
Senior Software Engineer
Concrete Software, Inc.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0X02hppRJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jul 22, 2016, 8:08:19 PM7/22/16
to Google Mobile Ads SDK Developers
Hi Ed,

I do apologize for the confusion. Basically for mediation for to work, you need their adaptor and the SDK in your project. With your sample app, you did not have the UnityAd SDK. You can use my sample app to load ads from UnityAd. How mediation works is like this - you make an AdRequest, the server would send a ad from your mediation network, if it's UnityAd, it would look for the UnityAd's adaptor and that would then render the ad from the UnityAd's SDK. Without the UnityAd SDK, you would not be able to load ads. 

Thanks,
Veer Busani
Mobile Ads SDK Team

On Friday, July 22, 2016 at 5:45:42 PM UTC-4, Ed Marty wrote:
No, I didn't create the unity-plugin-library.jar myself. I imported the Unity package downloaded from here:


I am using the Unity Ads service built into Unity, not any external library, which works fine when invoking them through C#, or if I hack around the broken adapter to tell it to display the ads anyway, using the Ad Unit ID in the example I provided.

Inline image 1

I don't have time to look at the sample just now, but I will try to get to it Monday to see if that solves the problem (but the UnityAdsAdapter.jar in the sample seems to have the same problem)
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Ed Marty
Senior Software Engineer
Concrete Software, Inc.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0X02hppRJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Ed Marty
Senior Software Engineer
Concrete Software, Inc.



--
Ed Marty
Senior Software Engineer
Concrete Software, Inc.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/0X02hppRJTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ria Chakraborty

unread,
Nov 16, 2016, 2:05:29 AM11/16/16
to Google Mobile Ads SDK Developers


On Saturday, July 23, 2016 at 5:38:19 AM UTC+5:30, Veer Arjun Busani(Mobile Ads SDK Team) wrote:
Hi Ed,

I do apologize for the confusion. Basically for mediation for to work, you need their adaptor and the SDK in your project. With your sample app, you did not have the UnityAd SDK. You can use my sample app to load ads from UnityAd. How mediation works is like this - you make an AdRequest, the server would send a ad from your mediation network, if it's UnityAd, it would look for the UnityAd's adaptor and that would then render the ad from the UnityAd's SDK. Without the UnityAd SDK, you would not be able to load ads. 

Thanks,
Veer Busani
Mobile Ads SDK Team


Hi, I facing the same situation as well. I looked at your sample app and added the UnityAd's SDK. But then, while building an apk, these errors come:

Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/ads/android/IUnityAdsListener;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/ads/android/UnityAds;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/ads/android/UnityAds$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/ads/android/UnityAds$2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/ads/android/UnityAds$3;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/ads/android/UnityAdsDeviceLog;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/ads/android/UnityAdsDeviceLog$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/ads/android/UnityAdsDeviceLog$UnityAdsLogLevel; 

I'm guessing this is happenning because with Unity Ad service, all these were included. Because there is a condition where I'm showing UnityAds specifically in my app, and it works fine. But I'm using AdMob mediation in another condition, where UnityAd is never coming. 

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Nov 16, 2016, 10:31:46 AM11/16/16
to Google Mobile Ads SDK Developers
Hi Ria,

Can you try again with this UnityAd only sample app and try again? You might be missing few steps in the integration. Can you confirm the UnityAd SDK and adaptor version along with the Mobile Ads Unity plugin? You can also send us a sample app that would reproduce the issue and we will have a look.

Thanks,
Arjun Busani
Mobile Ads SDK Team
Reply all
Reply to author
Forward
0 new messages