Problem with the latest AddMob Plugin for Unity

1,450 views
Skip to first unread message

Fred Becker

unread,
Apr 7, 2016, 1:00:14 PM4/7/16
to Google Mobile Ads SDK Developers
I'm using Unity 5.1.1f1 and I've download the latest version of the AdMob Plugin (Google Mobile Ads Unity Plugin v3.0.3).

Since then I'm getting the following error message:

Google.JarResolver.ResolutionException: Cannot find candidate artifact for com.google.android.gms:play-services-ads:LATEST
  at Google.JarResolver.PlayServicesSupport.DependOn (System.String group, System.String artifact, System.String version) [0x00000] in <filename unknown>:0


I've tried to change the  svcSupport.DependOn("com.google.android.gms", "play-services-ads","LATEST") in the AdMobDependencies.cs to svcSupport.DependOn("com.google.android.gms", "play-servicesads",PluginVersion.PlayServicesVersionConstraint). And removed <activityandroid:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity" android:theme="@style/Theme.IAPTheme"/> from the AndroidManifest,but it didn't work.


What can I do?


Thank you for the help!

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 7, 2016, 1:49:37 PM4/7/16
to Google Mobile Ads SDK Developers
Hi Fred,

It looks like that you are missing these libraries in your Android SDK. To fix this - 
  • Open up Unity and goto Preferences -> External Tools -> Android SDK Path and make sure that it pointing to right one. Or else download it. 
  • Next from your Android SDK folder and goto -> tools and open up Android.exe (Run in terminal if on Mac). Basically this would bring up your Android SDK Manager. 
  • Finally download these libraries in the Extras sections -
    • Google Play Services
    • Android Support Library
This would fix the issue. Try to make a build again and see if you are able to deploy it on your device.

Thanks,
Veer Busani
Mobile Ads SDK Team

Fred Becker

unread,
Apr 7, 2016, 3:14:20 PM4/7/16
to Google Mobile Ads SDK Developers
Hi Veer,
I've tried what you've said, but I'm still getting error messages:

Assets/PlayServicesResolver/Editor/AdMobDependencies.cs(16,83): error CS0103: The name `PluginVersion' does not exist in the current context

Assets/PlayServicesResolver/Editor/AdMobDependencies.cs(16,28): error CS1502: The best overloaded method match for `Google.JarResolver.PlayServicesSupport.DependOn(string, string, string)' has some invalid arguments

Assets/PlayServicesResolver/Editor/AdMobDependencies.cs(16,28): error CS1503: Argument `#3' cannot convert `object' expression to type `string'

What could it be?
Thanks

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 7, 2016, 5:10:24 PM4/7/16
to Google Mobile Ads SDK Developers
Hi Fred,

Would you be able to create a new project and import just the Mobile Ads plugin just for sanity check? You could also send us your sample app for us to debug the issue. The plugin is still unable to find the required Google Play Services frameworks. Would you mind printing out your EditorPrefs.GetString("AndroidSdkRoot") and checking whether it is pointing to the right Android SDK? 

Thanks,
Veer Busani
Mobile Ads SDK Team

Fred Becker

unread,
Apr 7, 2016, 8:26:08 PM4/7/16
to Google Mobile Ads SDK Developers
Hi Veer,

I've created a new project and imported the plugin again, just got the message again:


Google.JarResolver.ResolutionException: Cannot find candidate artifact for com.google.android.gms:play-services-ads:LATEST
  at Google.JarResolver.PlayServicesSupport.DependOn (System.String group, System.String artifact, System.String version) [0x00000] in <filename unknown>:0
  at AdMobDependencies..cctor () [0x00024] in G:\Games\AdTest\Assets\PlayServicesResolver\Editor\AdMobDependencies.cs:18
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])

I've also printed the EditorPrefs:

C:/Users/HP/AppData/Local/Android/android-sdk
UnityEngine.MonoBehaviour:print(Object)
Edit:Start() (at Assets/Scripts/Edit.cs:9)

it is pointing to the right folder. Could it be the SDK version?

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 8, 2016, 10:44:11 AM4/8/16
to Google Mobile Ads SDK Developers
Hi Fred,

The Android SDK location seems to be right. Now please make sure that you have google-play-services_lib folder at ~AndroidSDK Path -> extras -> google -> google_play_services -> libproject. The only issue here is that the plugin is unable to location the Google Play Services library. 

There is also something else that you could try. Copy over the google-play-services_lib folder into Assets -> Plugins -> Android. Then in AdMobDependencies.cs class, while initializing PlayServicesSupport, you specify the local path to that library. This time it must be able to pick up all the required dependencies.

Do let us know if this fixes the issue.

Thanks,
Veer Busani
Mobile Ads SDK Team


Fred Becker

unread,
Apr 15, 2016, 7:42:37 PM4/15/16
to google-adm...@googlegroups.com
Hi Veer,
sorry I was away and couldn't reply.
I've tried to do what you said, and I've got:

Assets/PlayServicesResolver/Editor/AdMobDependencies.cs(17,83): error CS0103: The name `PluginVersion' does not exist in the current context

Assets/PlayServicesResolver/Editor/AdMobDependencies.cs(17,28): error CS1502: The best overloaded method match for `Google.JarResolver.PlayServicesSupport.DependOn(string, string, string)' has some invalid arguments

Assets/PlayServicesResolver/Editor/AdMobDependencies.cs(17,28): error CS1503: Argument `#3' cannot convert `object' expression to type `string

Thank you.


--

---
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/xlWbwioX7ec/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,
Apr 18, 2016, 10:43:09 AM4/18/16
to Google Mobile Ads SDK Developers
Hi Fred,

Would you mind removing the plugins and the Android SDK and reinstalling from scratch? One quick way to do it would be to install Android Studio and it would ensure that the Android SDK is installed over the default directory.  The other way would be to copy the Google Play Services library (~Android SDK folder -> extras -> google -> google_play_services -> libproject -> google-play-services_lib) into the Assets folder. 

Thanks,
Veer Busani
Mobile Ads SDK Team

On Friday, April 15, 2016 at 7:42:37 PM UTC-4, Fred Becker wrote:
Hi Veer,
sorry I was away and couldn't reply.
I've tried to do what you said, and I've got:

Assets/PlayServicesResolver/Editor/AdMobDependencies.cs(17,83): error CS0103: The name `PluginVersion' does not exist in the current context

Assets/PlayServicesResolver/Editor/AdMobDependencies.cs(17,28): error CS1502: The best overloaded method match for `Google.JarResolver.PlayServicesSupport.DependOn(string, string, string)' has some invalid arguments

Assets/PlayServicesResolver/Editor/AdMobDependencies.cs(17,28): error CS1503: Argument `#3' cannot convert `object' expression to type `string

Thank you.


On Fri, Apr 8, 2016 at 11:44 AM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-admob-ads-sdk@googlegroups.com> wrote:
Hi Fred,

The Android SDK location seems to be right. Now please make sure that you have google-play-services_lib folder at ~AndroidSDK Path -> extras -> google -> google_play_services -> libproject. The only issue here is that the plugin is unable to location the Google Play Services library. 

There is also something else that you could try. Copy over the google-play-services_lib folder into Assets -> Plugins -> Android. Then in AdMobDependencies.cs class, while initializing PlayServicesSupport, you specify the local path to that library. This time it must be able to pick up all the required dependencies.

Do let us know if this fixes the issue.

Thanks,
Veer Busani
Mobile Ads SDK Team


On Thursday, April 7, 2016 at 8:26:08 PM UTC-4, Fred Becker wrote:
Hi Veer,

I've created a new project and imported the plugin again, just got the message again:

Google.JarResolver.ResolutionException: Cannot find candidate artifact for com.google.android.gms:play-services-ads:LATEST
  at Google.JarResolver.PlayServicesSupport.DependOn (System.String group, System.String artifact, System.String version) [0x00000] in <filename unknown>:0
  at AdMobDependencies..cctor () [0x00024] in G:\Games\AdTest\Assets\PlayServicesResolver\Editor\AdMobDependencies.cs:18
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])

I've also printed the EditorPrefs:

C:/Users/HP/AppData/Local/Android/android-sdk
UnityEngine.MonoBehaviour:print(Object)
Edit:Start() (at Assets/Scripts/Edit.cs:9)

it is pointing to the right folder. Could it be the SDK version?

--

---
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/xlWbwioX7ec/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.

Fred Becker

unread,
Apr 18, 2016, 3:00:55 PM4/18/16
to google-adm...@googlegroups.com
I've done that and nothing =/
Could it be a missing package?
Thank you

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.

--

---
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/xlWbwioX7ec/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.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 18, 2016, 5:26:16 PM4/18/16
to Google Mobile Ads SDK Developers
Hi Fred,

Just so that we are clear on this, you have a Google Play Services lib project in your Assets folder? Would you mind removing that and try again? The latest Mobile Ads plugin 3.0.x comes with a Jar Resolver, which essentially means that it would load up your dependencies for you. It would look at the default path for the Android SDK for this.

Thanks,
Veer Busani
Mobile Ads SDK Team

On Monday, April 18, 2016 at 3:00:55 PM UTC-4, Fred Becker wrote:
I've done that and nothing =/
Could it be a missing package?
Thank you
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.

--

---
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/xlWbwioX7ec/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.

Fred Becker

unread,
Apr 18, 2016, 6:29:21 PM4/18/16
to google-adm...@googlegroups.com
Hi Veer,
I've tried, but no result :/
There is a way to send the project?
Thank you!

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 19, 2016, 10:05:44 AM4/19/16
to Google Mobile Ads SDK Developers
Hi Fred,

You can send me your project by replying privately to me. We would certainly have a look into this.


Thanks,
Veer Busani
Mobile Ads SDK Team

Fred Becker

unread,
Apr 19, 2016, 11:09:52 AM4/19/16
to google-adm...@googlegroups.com
Where is this option?
Thanks :)

--

---
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/xlWbwioX7ec/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.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 19, 2016, 11:14:43 AM4/19/16
to Google Mobile Ads SDK Developers
Hi Fred,

I have sent you an email. We can continue this from there now.

Thanks,
Veer Busani
Mobile Ads SDK Team

On Tuesday, April 19, 2016 at 11:09:52 AM UTC-4, Fred Becker wrote:
Where is this option?
Thanks :)
On Tue, Apr 19, 2016 at 11:05 AM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-admob-ads-sdk@googlegroups.com> wrote:
Hi Fred,

You can send me your project by replying privately to me. We would certainly have a look into this.

Thanks,
Veer Busani
Mobile Ads SDK Team

On Monday, April 18, 2016 at 6:29:21 PM UTC-4, Fred Becker wrote:
Hi Veer,
I've tried, but no result :/
There is a way to send the project?
Thank you!

--

---
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/xlWbwioX7ec/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.

Fred Becker

unread,
Apr 19, 2016, 2:01:58 PM4/19/16
to Google Mobile Ads SDK Developers
Hi Veer,
did you received the file?

Fred Becker

unread,
Apr 21, 2016, 5:08:55 PM4/21/16
to google-adm...@googlegroups.com
Hi Veer,
I didn't got an answer.
Thank you

On Tue, Apr 19, 2016 at 3:01 PM, Fred Becker <fredb...@gmail.com> wrote:
Hi Veer,
did you received the file?

--

---
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/xlWbwioX7ec/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.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 22, 2016, 9:25:26 AM4/22/16
to Google Mobile Ads SDK Developers
Hi Fred,

I have received and looked into your project. I'm attaching you a sample project built for Unity 2D with the Mobile Ads Plugin set up. If this one still does not fix the issue, follow these steps ->
  • Make a new Unity Build and import the Custom Mobile Ads Plugin Package. Also copy the GoogleMobileAdsDemoScript.cs into your Assets -> Scripts folder.
  • Next make an Empty GameObject and attach the GoogleMobileAdsDemoScript.cs file as component. Make sure that you have added your Ad Unit ID in the script file.
  • Next Right Click on the Assets -> Google Mobile Ads folder and select Google Play Services -> Resolve Client Jars.
  • Then add your scene and go into your Android Player Settings and make sure that you update the Bundle Identifier.
  • Build and Run.
Do let us know if this fixes the issue. Do not copy anything else, including the Google Play Services library.

Note: My apologies. This was in the outbox and was never sent. 

Attachment: Sample Project Link

Thanks,
Veer Busani
Mobile Ads SDK Team

On Thursday, April 21, 2016 at 5:08:55 PM UTC-4, Fred Becker wrote:
Hi Veer,
I didn't got an answer.
Thank you
On Tue, Apr 19, 2016 at 3:01 PM, Fred Becker <fredb...@gmail.com> wrote:
Hi Veer,
did you received the file?

--

---
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/xlWbwioX7ec/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.

Fred Becker

unread,
Apr 22, 2016, 6:53:29 PM4/22/16
to google-adm...@googlegroups.com
Hi Veer,
I'm still getting:


Google.JarResolver.ResolutionException: Cannot find candidate artifact for com.google.android.gms:play-services-ads:LATEST
  at Google.JarResolver.PlayServicesSupport.LoadDependencies (Boolean allClients) [0x00000] in <filename unknown>:0
  at Google.JarResolver.PlayServicesSupport.CreateInstance (System.String clientName, System.String sdkPath, System.String settingsDirectory) [0x00000] in <filename unknown>:0
  at AdMobDependencies..cctor () [0x0000a] in E:\Jogos\MAD 3.0.3 2D\MAD 3.0.3 2D\Assets\PlayServicesResolver\Editor\AdMobDependencies.cs:14
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])

but it did built this time around.
Thank you

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.

--

---
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/xlWbwioX7ec/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.

Fred Becker

unread,
Apr 22, 2016, 7:22:07 PM4/22/16
to google-adm...@googlegroups.com
would that be a problem?

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 25, 2016, 1:12:32 PM4/25/16
to Google Mobile Ads SDK Developers
Hi Fred,

Would you mind making a new build on the same drive as your Android SDK folder? Do let us know if that is causing the issue.

Thanks,
Veer Busani
Mobile Ads SDK Team

On Friday, April 22, 2016 at 7:22:07 PM UTC-4, Fred Becker wrote:
would that be a problem?
On Fri, Apr 22, 2016 at 7:53 PM, Fred Becker <fredb...@gmail.com> wrote:
Hi Veer,
I'm still getting:

Google.JarResolver.ResolutionException: Cannot find candidate artifact for com.google.android.gms:play-services-ads:LATEST
  at Google.JarResolver.PlayServicesSupport.LoadDependencies (Boolean allClients) [0x00000] in <filename unknown>:0
  at Google.JarResolver.PlayServicesSupport.CreateInstance (System.String clientName, System.String sdkPath, System.String settingsDirectory) [0x00000] in <filename unknown>:0
  at AdMobDependencies..cctor () [0x0000a] in E:\Jogos\MAD 3.0.3 2D\MAD 3.0.3 2D\Assets\PlayServicesResolver\Editor\AdMobDependencies.cs:14
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])

but it did built this time around.
Thank you
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.

--

---
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/xlWbwioX7ec/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.

Fred Becker

unread,
May 12, 2016, 2:09:56 PM5/12/16
to google-adm...@googlegroups.com
Sorry to take a while to answer.
 I've found the problem I needed latest versions of following packages:
  1. Extras / Android Support Repository
  2. Extras / Google Repository

This solved the problem for me.

Thank you for all the help!



On Mon, Apr 25, 2016 at 2:12 PM, 'Veer Arjun Busani(Mobile Ads SDK Team)' via Google Mobile Ads SDK Developers <google-adm...@googlegroups.com> wrote:
Hi Fred,

Would you mind making a new build on the same drive as your Android SDK folder? Do let us know if that is causing the issue.

Thanks,
Veer Busani
Mobile Ads SDK Team

On Friday, April 22, 2016 at 7:22:07 PM UTC-4, Fred Becker wrote:
would that be a problem?
On Fri, Apr 22, 2016 at 7:53 PM, Fred Becker <fredb...@gmail.com> wrote:
Hi Veer,
I'm still getting:

Google.JarResolver.ResolutionException: Cannot find candidate artifact for com.google.android.gms:play-services-ads:LATEST
  at Google.JarResolver.PlayServicesSupport.LoadDependencies (Boolean allClients) [0x00000] in <filename unknown>:0
  at Google.JarResolver.PlayServicesSupport.CreateInstance (System.String clientName, System.String sdkPath, System.String settingsDirectory) [0x00000] in <filename unknown>:0
  at AdMobDependencies..cctor () [0x0000a] in E:\Jogos\MAD 3.0.3 2D\MAD 3.0.3 2D\Assets\PlayServicesResolver\Editor\AdMobDependencies.cs:14
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])

but it did built this time around.
Thank you
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.

--

---
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/xlWbwioX7ec/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.

--

---
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/xlWbwioX7ec/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.
Reply all
Reply to author
Forward
0 new messages