Setting up GPGS for Android Native Builds

Hi!

I’m having a hard time trying to setup an Android Native project with GPGS. I’ve read the docs but I’m not sure yet how to proceed. I’m not sure how I should try to include the GPGS libs into the project. After running the download_plugins script, I copied the resulting jar (plugin.gpgs.v2.jar) into my libs folder. I also included the following dependencies in my gradle file:

dependencies { api fileTree(dir: 'libs', include: '\*.jar') implementation 'com.google.android.gms:play-services-base:11.0.4' implementation 'com.google.android.gms:play-services-drive:11.0.4' implementation 'com.google.android.gms:play-services-games:11.0.4' implementation 'com.android.support:appcompat-v7:25.3.1' implementation 'com.android.support:support-v4:25.3.1' implementation 'com.android.support.constraint:constraint-layout:1.0.2' api project(':plugin') }

And updated the AndroidManifest to point out that these plugins are needed:

\<meta-data android:name="usesGooglePlayServicesComponentGames" android:value="true" /\> \<meta-data android:name="usesGooglePlayServicesComponentDrive" android:value="true" /\>

But the result is always the same when I run the game:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/games/multiplayer/realtime/RoomStatusUpdateCallback;

So, it seems GPGS libs are not properly setup.

Could you please help?

Hi again!

I’ve restarted the whole process using the new App Template from the latest daily build (3504) and it seems much better than trying to do everything manually. I’ve run the setUpCoronaAppAndPlugins gradle task and the setup was magically done by the script (thanks Corona!). The apk has been built, but when I run it on the device I get an error saying I should not include Google Play Services as the app does not target the Google Play Store. As I’m not building the apk from Corona, but from Android Studio, where should I assign that its target is the Google Play Store?

Answering myself (and someone who may run into the same problem in the future).

There is an entry in the Android Manifest:

\<meta-data android:name="targetedAppStore" android:value="none" /\>

Just change the value to “google” and it’s done.

Hi again!

I’ve restarted the whole process using the new App Template from the latest daily build (3504) and it seems much better than trying to do everything manually. I’ve run the setUpCoronaAppAndPlugins gradle task and the setup was magically done by the script (thanks Corona!). The apk has been built, but when I run it on the device I get an error saying I should not include Google Play Services as the app does not target the Google Play Store. As I’m not building the apk from Corona, but from Android Studio, where should I assign that its target is the Google Play Store?

Answering myself (and someone who may run into the same problem in the future).

There is an entry in the Android Manifest:

\<meta-data android:name="targetedAppStore" android:value="none" /\>

Just change the value to “google” and it’s done.