Hello,
I’m struggling to figure out how to include the google play services into my app.
I don’t need help with the google play services itself, I have a Visual Studio NSignt question…
According to this site:
It says “When developing for Android, include the Play Games services SDK as a library project, not as a standalone JAR”. I cannot find where to do this. In the ANT properties I found the location for adding JAR’s, but they clearly don’t want you to do that with this.
Is there a way to add a “Library Project” with your NVidia Tools in Visual Studio? How would I go about doing that?
Thanks
Jeff.
Hi Jeff,
We don’t support Android library projects in Nsight Tegra, meaning you’ll need to reference them manually in Ant property files. Here’s an article on Android Developers describing how to do that: [url]android | Android Developers
Hello Dmitry
Can I just change project.properties file as below?
This file is automatically generated by Android Tools.
Do not modify this file – YOUR CHANGES WILL BE ERASED!
This file must be checked in Version Control Systems.
To customize properties used by the Ant build system use,
“ant.properties”, and override values to adapt the script to your
project structure.
Project target.
target=android-15
android.library.reference.1=…/google-play-services_lib
Hi Fatming,
You should be able to do that! Alternatively, you can try running “android update project” with --library argument as described in the link I mentioned above.
Hi there, is this still the way to do this or does the latest version of Android Code Works support adding a library project now?
Via gradle override (nsight_tegra_build_overrides.gradle)
copy
{
from "$System.env.ANDROID_HOME/extras/google/play_billing/IInAppBillingService.aidl"
into "aidl/com/android/vending/billing"
}
android
{
repositories
{
mavenCentral()
maven { url 'https://dl.bintray.com/alexeydanilov/apk-expansion' } // DownloaderService support
// there is other useful stuff also, https://github.com/danikula/Google-Play-Expansion-File
}
if (sourceSets.hasProperty("google"))
{
sourceSets.google
{
aidl.srcDirs += ['aidl']
}
}
}
def googlePlayVersion = '8.4.0'
dependencies
{
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
compile 'com.google.android.gms:play-services-games:' + googlePlayVersion
compile 'com.google.android.gms:play-services-ads:' + googlePlayVersion
compile 'com.danikula.expansion:expansion:1.1@aar' // DownloaderService support
compile 'com.danikula.expansion:license:1.5@aar'
}
Good to know!
I finally got this all working.
I realized that setting your target Android API to 21 makes is the key to making this work without major issues or hacks.