Play-games-plugin-for-unity: Gradle Issue

Created on 1 Nov 2017  路  21Comments  路  Source: playgameservices/play-games-plugin-for-unity

So I'm trying to export my game to gradle, but there is an error. Im using the newest package and still giving me this error.

screen shot 2017-11-01 at 18 41 11

And here is the error on the console.

CommandInvokationFailure: Gradle build failed.
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -classpath "/Volumes/HDD/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-2.14.jar" org.gradle.launcher.GradleMain "assembleDebug"

stderr[
/Volumes/HDD/Proyectos Unity/Game Android/Temp/gradleOut/GooglePlayGamesManifest.plugin/build/intermediates/bundles/release/aapt/AndroidManifest.xml:35:28-65: AAPT: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 21.177 secs
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.GradleWrapper.RunJava (System.String args, System.String workingdir, UnityEditor.Android.Progress progress)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.RunJava (System.String args, System.String workingdir, UnityEditor.Android.Progress progress)
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, UnityEditor.Android.Progress progress)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Is there a solution?

Most helpful comment

So for the plugin and the gradle build you will need to MOVE (not copy) the
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
into a Plugins/Android/AndroidManifest.xml file.
You do not have the file, so you have to create yourself one and move the aforementioned bit from the googleplay androidmanifest to that newly created one.

All 21 comments

Did you run in Unity->Window->Google Play Games->Android Setup? I see this error mostly when i reimported the plugin and GameInfo.cs has been overwritten with default values.

Yes I did, all the time when I update play services I do that.

and do you have this:
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
in Plugins/Android/AndroidManifest.xml?

That is the problem, it doesn't generate any manifest in that folder.

is it then in GooglePlayGames/Plugins/Android/GooglePlayGamesManifest.plugin/AndroidManifest.xml?

Yes is there should I copy that Manifest in to Plugins/Android/AndroidManifest.xml?

ah no, no need as far as i know, as it all gets merged into the final build anyway.
In the AndroidManifest.xml you are having, does your APP_ID .games.unityVersion have both values?

In that manifest this is everything I have. //The manifest from Assets/GooglePlayGames/Plugins/Android/GoogleplayGamesManifest.plugin

screen shot 2017-11-02 at 11 55 10

Also I am thinking, so maybe your idea with copying the Manifest wouldnt be bad. Maybe not copy it exactly (because gradle doesnt like having the google_play_services_version in the GooglePlayGamesManifest.plugin/AndroidManifest.xml, but in the Plugins/AndroidManifest.xml, so maybe just move the line from one place to the other. Thats the only more thing I can think of at the moment, sorry!

Looks good. Maybe remove the app id from being displayed, but that manifest looks correct

Okay, I'm gonna try some things and will wait for a new answer. Gonna update this if I find some solutions. Thank you!

do you have also a sample project? I can have a look

Sure, where should I send you the project? Because it's a released game.

just build up a generic test bed project where most of your code is gone (including the app_id and the project name), but with all the plugins and other android manifests youve got hanging about and upload it somewhere on one of the file transfer websites maybe? What I also do when ive got troubles is just put the plugin in a test bed project and compile it from there and check if its not some of the other plugins that screw the build up.

Oh I just tried some stuff around to see which plugins are not needed any more, just a quick question: what plugins do you have from play-services?
I can compile the project with no problems by just having these:
untitled

actually dont worry about sending your project, i can finally get your error on my machine now too (i wasnt building with gradle before). Im investigating now

I'm using Admob //gonna delete this one when I configure Audience Network//, Firebase, Play Games and Audience Network.

Okay, thank you!

So for the plugin and the gradle build you will need to MOVE (not copy) the
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
into a Plugins/Android/AndroidManifest.xml file.
You do not have the file, so you have to create yourself one and move the aforementioned bit from the googleplay androidmanifest to that newly created one.

Yes! It's working, thank you! Should I close the Issue?

yes please :)

Was this page helpful?
0 / 5 - 0 ratings