# Setting up GPGS for Android Native Builds

**URL:** <https://forums.solar2d.com/t/setting-up-gpgs-for-android-native-builds/350225>\
**Category:** Native builds\
**Created:** [July 24, 2019, 3:48pm UTC](https://forums.solar2d.com/t/setting-up-gpgs-for-android-native-builds/350225 "2019-07-24T15:48:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![impossibleapps](https://forums.solar2d.com/user_avatar/forums.solar2d.com/impossibleapps/32/479_2.png) [@impossibleapps](https://forums.solar2d.com/u/impossibleapps)\
**Post date:** [July 24, 2019, 3:48pm UTC](https://forums.solar2d.com/t/setting-up-gpgs-for-android-native-builds/350225/1 "2019-07-24T15:48:15Z")

</div>

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&nbsp;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?

---

<div class="post-metadata">

**Author:** ![impossibleapps](https://forums.solar2d.com/user_avatar/forums.solar2d.com/impossibleapps/32/479_2.png) [@impossibleapps](https://forums.solar2d.com/u/impossibleapps)\
**Post date:** [July 25, 2019, 5:53pm UTC](https://forums.solar2d.com/t/setting-up-gpgs-for-android-native-builds/350225/2 "2019-07-25T17:53:38Z")

</div>

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&nbsp;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?

---

<div class="post-metadata">

**Author:** ![impossibleapps](https://forums.solar2d.com/user_avatar/forums.solar2d.com/impossibleapps/32/479_2.png) [@impossibleapps](https://forums.solar2d.com/u/impossibleapps)\
**Post date:** [July 25, 2019, 6:43pm UTC](https://forums.solar2d.com/t/setting-up-gpgs-for-android-native-builds/350225/3 "2019-07-25T18:43:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![impossibleapps](https://forums.solar2d.com/user_avatar/forums.solar2d.com/impossibleapps/32/479_2.png) [@impossibleapps](https://forums.solar2d.com/u/impossibleapps)\
**Post date:** [July 25, 2019, 5:53pm UTC](https://forums.solar2d.com/t/setting-up-gpgs-for-android-native-builds/350225/4 "2019-07-25T17:53:38Z")

</div>

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&nbsp;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?

---

<div class="post-metadata">

**Author:** ![impossibleapps](https://forums.solar2d.com/user_avatar/forums.solar2d.com/impossibleapps/32/479_2.png) [@impossibleapps](https://forums.solar2d.com/u/impossibleapps)\
**Post date:** [July 25, 2019, 6:43pm UTC](https://forums.solar2d.com/t/setting-up-gpgs-for-android-native-builds/350225/5 "2019-07-25T18:43:16Z")

</div>

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.
