Android plugin using play-services-nearby

ColeimColeim Posts: 1Member


I am trying to create a new Android plugin that will use the play-services-nearby API.
I am working with the exe and export templates I found here:

When adding a simple class it works well. Then I just add the dependency to nearby api, by adding to gradle.conf:

implementation ''

I got then this error:

Looks like an incompatibility with the nearby api, using androidx.

So I tested several solutions, but none of them seems to works. (I'll explain below)
Does anyone have an idea how can I fix it ?

Downgrade play-services-nearby

Looking on the internet, it seems that we can downgrade the api version to have it compatible with non x android.

So I used 'play-services-nearby:16.0.0'.
Then the following error pop:

I then changed the gradle.conf to:

implementation ''
implementation ''

This make gradle pass, however godot then completely crashes with the error:

ERROR: get: FATAL: Index p_index=-1 out of size (size()=62)
   At: ./core/cowdata.h:151


As suggested in the logs, I tried to use in the manifest:


But new error occur, and it seems that some libs are duplicated.

Use android X

I tried to migrate the build to androidx, by adding to


Then needed some changes to migrate (looking at => => androidx.core.content.ContextCompat => androidx.annotation.Keep

The gradle build works, but then godot crashes with the same error:

ERROR: get: FATAL: Index p_index=-1 out of size (size()=62)
   At: ./core/cowdata.h:151

So I am a little bit stuck and looking for ideas.
Also, if someone knows how to copy/paste the output of the gradle build in godot (or find the log file), it will help instead of pasting images :)

If needed, I can provide the code example I am using.

Does anyone have any idea on how to use it ? Or already implement nearby plugin ?

Thanks a lot !

Tags :

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file