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.

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.
What went wrong:
Execution failed for task ':GooglePlayGamesManifest.plugin:processReleaseResources'.com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Volumes/HDD/Android/build-tools/26.0.2/aapt'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
]
stdout[
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:Firebase:preBuild UP-TO-DATE
:Firebase:preReleaseBuild UP-TO-DATE
:Firebase:compileReleaseNdk UP-TO-DATE
:Firebase:compileLint
:Firebase:copyReleaseLint UP-TO-DATE
:Firebase:mergeReleaseProguardFiles UP-TO-DATE
:Firebase:packageReleaseRenderscript UP-TO-DATE
:Firebase:checkReleaseManifest
:Firebase:prepareReleaseDependencies
:Firebase:compileReleaseRenderscript
:Firebase:generateReleaseResValues UP-TO-DATE
:Firebase:generateReleaseResources
:Firebase:packageReleaseResources
:Firebase:compileReleaseAidl
:Firebase:generateReleaseBuildConfig
:Firebase:mergeReleaseShaders
:Firebase:compileReleaseShaders
:Firebase:generateReleaseAssets
:Firebase:mergeReleaseAssets
:Firebase:processReleaseManifest
:Firebase:processReleaseResources
:Firebase:generateReleaseSources
:Firebase:incrementalReleaseJavaCompilationSafeguard
:Firebase:compileReleaseJavaWithJavac
:Firebase:processReleaseJavaRes UP-TO-DATE
:Firebase:transformResourcesWithMergeJavaResForRelease
:Firebase:transformClassesAndResourcesWithSyncLibJarsForRelease
:Firebase:mergeReleaseJniLibFolders
:Firebase:transformNative_libsWithMergeJniLibsForRelease
:Firebase:transformNative_libsWithSyncJniLibsForRelease
:Firebase:bundleRelease
:GoogleMobileAdsPlugin:preBuild UP-TO-DATE
:GoogleMobileAdsPlugin:preReleaseBuild UP-TO-DATE
:GoogleMobileAdsPlugin:compileReleaseNdk UP-TO-DATE
:GoogleMobileAdsPlugin:compileLint
:GoogleMobileAdsPlugin:copyReleaseLint UP-TO-DATE
:GoogleMobileAdsPlugin:mergeReleaseProguardFiles UP-TO-DATE
:GoogleMobileAdsPlugin:packageReleaseRenderscript UP-TO-DATE
:GoogleMobileAdsPlugin:checkReleaseManifest
:GoogleMobileAdsPlugin:prepareReleaseDependencies
:GoogleMobileAdsPlugin:compileReleaseRenderscript
:GoogleMobileAdsPlugin:generateReleaseResValues UP-TO-DATE
:GoogleMobileAdsPlugin:generateReleaseResources
:GoogleMobileAdsPlugin:packageReleaseResources
:GoogleMobileAdsPlugin:compileReleaseAidl
:GoogleMobileAdsPlugin:generateReleaseBuildConfig
:GoogleMobileAdsPlugin:mergeReleaseShaders
:GoogleMobileAdsPlugin:compileReleaseShaders
:GoogleMobileAdsPlugin:generateReleaseAssets
:GoogleMobileAdsPlugin:mergeReleaseAssets
:GoogleMobileAdsPlugin:processReleaseManifest
:GoogleMobileAdsPlugin:processReleaseResources
:GoogleMobileAdsPlugin:generateReleaseSources
:GoogleMobileAdsPlugin:incrementalReleaseJavaCompilationSafeguard
:GoogleMobileAdsPlugin:compileReleaseJavaWithJavac
:GoogleMobileAdsPlugin:processReleaseJavaRes UP-TO-DATE
:GoogleMobileAdsPlugin:transformResourcesWithMergeJavaResForRelease
:GoogleMobileAdsPlugin:transformClassesAndResourcesWithSyncLibJarsForRelease
:GoogleMobileAdsPlugin:mergeReleaseJniLibFolders
:GoogleMobileAdsPlugin:transformNative_libsWithMergeJniLibsForRelease
:GoogleMobileAdsPlugin:transformNative_libsWithSyncJniLibsForRelease
:GoogleMobileAdsPlugin:bundleRelease
:GooglePlayGamesManifest.plugin:preBuild UP-TO-DATE
:GooglePlayGamesManifest.plugin:preReleaseBuild UP-TO-DATE
:GooglePlayGamesManifest.plugin:compileReleaseNdk UP-TO-DATE
:GooglePlayGamesManifest.plugin:compileLint
:GooglePlayGamesManifest.plugin:copyReleaseLint UP-TO-DATE
:GooglePlayGamesManifest.plugin:mergeReleaseProguardFiles UP-TO-DATE
:GooglePlayGamesManifest.plugin:packageReleaseRenderscript UP-TO-DATE
:GooglePlayGamesManifest.plugin:checkReleaseManifest
:GooglePlayGamesManifest.plugin:prepareReleaseDependencies
:GooglePlayGamesManifest.plugin:compileReleaseRenderscript
:GooglePlayGamesManifest.plugin:generateReleaseResValues UP-TO-DATE
:GooglePlayGamesManifest.plugin:generateReleaseResources
:GooglePlayGamesManifest.plugin:packageReleaseResources
:GooglePlayGamesManifest.plugin:compileReleaseAidl
:GooglePlayGamesManifest.plugin:generateReleaseBuildConfig
:GooglePlayGamesManifest.plugin:mergeReleaseShaders
:GooglePlayGamesManifest.plugin:compileReleaseShaders
:GooglePlayGamesManifest.plugin:generateReleaseAssets
:GooglePlayGamesManifest.plugin:mergeReleaseAssets
:GooglePlayGamesManifest.plugin:processReleaseManifest
:GooglePlayGamesManifest.plugin:processReleaseResources FAILEDBUILD 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?
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

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:

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 :)
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.