Unity Android build play srvices with Gradle

956 views
Skip to first unread message

dmitry....@onthespotdev.com

unread,
Jul 31, 2017, 6:01:44 AM7/31/17
to Google Mobile Ads SDK Developers
I can't build my Unity3D project with play services using Gradle. I've tried to build this sample google project, but got the same error:

"stderr[
D:\Projects\MAD 3.0.5\Temp\gradleOut\GoogleMobileAdsPlugin\build\intermediates\bundles\release\aapt\AndroidManifest.xml:25:28-65: AAPT: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version')."

Deepika Uragayala- MobileAds SDK team

unread,
Jul 31, 2017, 1:38:31 PM7/31/17
to Google Mobile Ads SDK Developers
Hi Dmitry,

You seem to be using a very old version of our Mobile Ads plugin. Currently, it's at v3.6.1 and you can get it from here. I would suggest that you create a new project, import our plugin and see if you are able to build. Make sure that the Android SDK path is pointing to the correct directory and has Google Play Services and Android SDK Build Tools updated. If you are still unable to build, then send us the error logs and we will have a look into this.

Regards,
Deepika Uragayala
Mobile Ads SDK Team

dmitry....@onthespotdev.com

unread,
Aug 1, 2017, 5:24:24 AM8/1/17
to Google Mobile Ads SDK Developers
Ok, so I've created project with latest SDK and got the same error. Here it is
Error : 
stderr[
D:\Projects\Test_google\Temp\gradleOut\mopub\build\intermediates\bundles\release\aapt\AndroidManifest.xml:80:28-65: AAPT: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').

Google plugin builds fine, but when I need to add some other plugin, which uses play services and build with Gradle, I get build errors. In attached project I've added latest google and mopub plugin. Mopub has  this meta info in manifest:
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>

which causes problems, but mopub team claims that they've done everything according to google specifications, so the problem is on google's side

Deepika Uragayala- MobileAds SDK team

unread,
Aug 1, 2017, 11:01:59 AM8/1/17
to Google Mobile Ads SDK Developers
Hi Dmitry,

It looks like the project is unable to compile due to the missing GMS dependency. You can right click on the Assets folder and select Play Services Resolver > Android Resolver > Resolve Client JARs. This will import all of the needed dependencies into your Plugins > Android folder. If it does not import, then you might be missing the Android SDK path from your Unity > Preferences > External Tools section. Let us know if that resolves the issue. 


Regards,
Deepika Uragayala
Mobile Ads SDK Team

dmitry....@onthespotdev.com

unread,
Aug 2, 2017, 7:45:00 AM8/2/17
to Google Mobile Ads SDK Developers
No, it doesn't help, same error. Forgot to say, if you build the project I sent you with unity internal build system, everything is fine, so I think the problem isn't in missed libraries. By the way, have you tried to build project I sent you after improvements you suggested? Is it works?

Deepika Uragayala- MobileAds SDK team

unread,
Aug 2, 2017, 3:43:54 PM8/2/17
to Google Mobile Ads SDK Developers
Hi Dmitry,

Just now confirmed with the team that our Unity Plugin still does not support Gradle yet and you would have to use the Internal Build System for now. I don't have a timeline yet on when this would be supported. You can keep an eye out on our release history page for new updates.

Regards,
Deepika Uragayala
Mobile Ads SDK Team

dmitry....@onthespotdev.com

unread,
Aug 3, 2017, 6:18:51 AM8/3/17
to Google Mobile Ads SDK Developers
The problem is that I can't build project with internal unity build system because of limit of method references (65k). Is it possible to export project for Gradle and configure it to work properly?

Deepika Uragayala- MobileAds SDK team

unread,
Aug 3, 2017, 3:27:51 PM8/3/17
to Google Mobile Ads SDK Developers
Hi Dmitry,

So I was able to build with a new project using Gradle and adding our Mobile Ads Unity Plugin without any issues. It looks like a third party library within your project might be causing this issue and it is definitely not coming from our SDK. I would suggest that you create a new project or use this one and then add your other needed libraries and check which one might be causing this. I suspect that your library might be having an older Google Play Services dependency.

Note: If the sample app asks for a password for the Key, it should be - hpmx51.

Let me know if that helps!!

Regards,
Deepika Uragayala
Mobile Ads SDK Team


Reply all
Reply to author
Forward
0 new messages