When using Unity gradle build , build fails due to:
/Temp/gradleOut/MainLibProj/build/intermediates/bundles/release/aapt/AndroidManifest.xml:31:28-65: AAPT: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').
This seems to be happening because @integer/google_play_services_version is being referenced in MainLibProj AndroidManifest.xml, but the res/version/version.xml holding the google_play_services_version value doesn't exist.
Adding the version.xml or removing reference of the google_play_services_version from Manifest allows the build to succeed. In some cases (like some ad plugins) reference to the version is necessary.
You need to modify the dependencies within the build.gradle that is generated by Unity to depend on play-services. Add something like:
dependencies {
compile 'com.google.android.gms:play-services-base:10.2.0'
}
Add something like
@claywilkinson This doesn't help.
I've copied mainTemplate.gradle from Unity installation to appropriate path in project. Added compile 'com.google.android.gms:play-services-base:9.6.1' (we are bound to old version of services) like this:
dependencies {
// 2017-10-05 Viktor: https://github.com/playgameservices/play-games-plugin-for-unity/issues/1710
compile 'com.google.android.gms:play-services-base:9.6.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
**DEPS**}
After export this expands to
dependencies {
// 2017-10-05 Viktor: https://github.com/playgameservices/play-games-plugin-for-unity/issues/1710
compile 'com.google.android.gms:play-services-base:9.6.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name: 'appcompat-v7-23.1.1', ext:'aar')
compile(name: 'cardview-v7-23.1.1', ext:'aar')
compile(name: 'EtceteraPlugin', ext:'aar')
compile(name: 'facebook-android-sdk-4.9.0', ext:'aar')
compile(name: 'facebook-android-wrapper-7.4.0', ext:'aar')
compile(name: 'FacebookAudienceNetwork-4.10.0', ext:'aar')
compile(name: 'FlurryPlugin', ext:'aar')
compile(name: 'fyber-facebook-4.10.0-r4', ext:'aar')
compile(name: 'GoogleCloudMessagingPlugin', ext:'aar')
compile(name: 'play-services-ads-lite-9.6.1', ext:'aar')
compile(name: 'play-services-auth-9.6.1', ext:'aar')
compile(name: 'play-services-auth-base-9.6.1', ext:'aar')
compile(name: 'play-services-base-9.6.1', ext:'aar')
compile(name: 'play-services-basement-9.6.1', ext:'aar')
compile(name: 'play-services-drive-9.6.1', ext:'aar')
compile(name: 'play-services-games-9.6.1', ext:'aar')
compile(name: 'play-services-gcm-9.6.1', ext:'aar')
compile(name: 'play-services-iid-9.6.1', ext:'aar')
compile(name: 'play-services-nearby-9.6.1', ext:'aar')
compile(name: 'play-services-tasks-9.6.1', ext:'aar')
compile(name: 'support-v4-24.0.0', ext:'aar')
compile project(':IAB_lib')
compile project(':MainLibProj')
compile project(':NoodlePermissionGranter')
compile project(':SocialNetworking_lib')
compile project(':unity-android-resources')
compile project(':UnityOBBDownloader')
}
But nothing changes if I try to build using Gradle without exporting. Still no @integer/google_play_services_version.
@claywilkinson Have you ever tried to build imported plugin with Gradle in Unity?
I had to remove this line from Assets/GPG/Plugins/Android/AndroidManifest.xml
<!-- Build time check to make sure play-services libraries are present -->
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Because I have the same error with Gradle build on last version GPG and Unity 5.
Most helpful comment
I had to remove this line from Assets/GPG/Plugins/Android/AndroidManifest.xml
<!-- Build time check to make sure play-services libraries are present --> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />Because I have the same error with Gradle build on last version GPG and Unity 5.