MrStahlfelge / gdx-gamesvcs

Easy integration of gameservices in your libGDX game: Google Play Games, Apple Game Center, Amazon GameCircle and more
Apache License 2.0
113 stars 20 forks source link

Project doesn't build with gpg on android with build tools 28 / gradle 4.6 #27

Closed SimonIT closed 5 years ago

SimonIT commented 5 years ago

Recently I upgraded my Gradle version to 4.6 from 3.5.1. But this annoying error appears:

Android resource linking failed
Output:  D:\Software\Entwicklung\TurbanGuy\android\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:423: error: resource android:attr/preserveIconSpacing is private.
error: failed linking references.

Command: C:\Users\simon\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\51876d9a334f74c9c5f25b354472a28b\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
        D:\Android-SDK\platforms\android-28\android.jar\
        --manifest\
        D:\Software\Entwicklung\TurbanGuy\android\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
        -o\
        D:\Software\Entwicklung\TurbanGuy\android\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
        -R\
        @D:\Software\Entwicklung\TurbanGuy\android\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        D:\Software\Entwicklung\TurbanGuy\android\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
        --custom-package\
        de.nta15.turbanguy.android\
        -0\
        apk\
        --output-text-symbols\
        D:\Software\Entwicklung\TurbanGuy\android\build\intermediates\symbols\debug\R.txt\
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

I found the source in gamesvcs-android-gpgs. Because if I comment the line compile "de.golfgl.gdxgamesvcs:gdx-gamesvcs-android-gpgs:$gamesvcsVersion" in my project, I can build it.

I use libgdx 1.9.8 and gdx-gamesvcs 0.2.3.

MrStahlfelge commented 5 years ago

Hi, you are building your libGDX game with Gradle 4.6? AFAIK and according to the issue tracker, Gradle >= 4 is not supported.

SimonIT commented 5 years ago

I know. But if I generate a new project with the setup application, the project comes with Gradle 4.6🤷🏾‍♂️ So I thought it would run and it does, but only without this extension. So I think it's a problem with this extension and not with libgdx.

MrStahlfelge commented 5 years ago

What is your compileSdkVersion and buildToolsVersion?

SimonIT commented 5 years ago
buildToolsVersion "28.0.3"
compileSdkVersion 28

I tested with 27, but it failed too

SimonIT commented 5 years ago

any progress? If you need more information, just ask

MrStahlfelge commented 5 years ago

I asked here if Gradle 4.6 is now officially supported. No answer. I don't know if the changed setup tool template was done accidently or by intention, therefore I stay on the older Gradle version with my projects and would recommend you also to do so with 1.9.8.

When 1.9.9 is released with official Gradle 4.6 support, I will adopt the necessary changes.

SimonIT commented 5 years ago

LibGDX 1.9.9 is released and the linked issue of you is closed. I think it's the sign that Gradle 4.6 is officially supported

MrStahlfelge commented 5 years ago

Interesting, the release was created yesterday. But there is still no official announcement.

SimonIT commented 5 years ago

Do you think there will be any official announcement? The last one was at version 1.5.1 (based on the CHANGES file) with Gradle 2.2 which was for 4 years.

MrStahlfelge commented 5 years ago

I would expect it here: https://www.badlogicgames.com/wordpress/ bundled with some notes if there are any changes necessary when upgrading existing projects.

MrStahlfelge commented 5 years ago

I gave this a shot today. The problem is indeed caused by build tools 28.0.2 interphering with GPGS services lib 8.4 and has nothing to do with Gradle. But with Gradle 4.6, it is not possible to use an older build tools version (setting to 27 is overriden which is stated when you sync the project). Unfortunately, using GPGS services 11.4.2 does not help either. This was the last compatible version before the major change.

SimonIT commented 5 years ago

What's the minimum version that can be used? 12? What is against using this version?

MrStahlfelge commented 5 years ago

Found out the problem was not caused by GPGS, but by support and G+ libs that were included. I've included them because this was done in Google's example project, but it seems they are not necessary. Without them, everything works. I updated to 11.4.2 anyway and check. You'll get a running version soon.

MrStahlfelge commented 5 years ago

Change to 0.2.4-SNAPSHOT, should work for you now. It builds and works against this project

SimonIT commented 5 years ago

great! Thank you very much

MrStahlfelge commented 5 years ago

I want to publish a new release with this change. Does it work for you now?

SimonIT commented 5 years ago

Yes, it works

MrStahlfelge commented 5 years ago

Great to hear. I close this issue now and publish a release in the next days.

Thanks for putting me on this.