Closed S3riousSam closed 8 years ago
The instructions for a command line build are in README.build - it says that NDK_MODULE_PATH should be set to the location that the SDK was expanded. I suggest in Common/gpg-sdk.
You can also try to use the experimental Android Studio support to build with Gradle: http://tools.android.com/tech-docs/android-ndk-preview
"NDK_MODULE_PATH to the location of the Play Games cpp libraries."... I understand this refers to the root of the cpp-android-basic-samples zip content, right?
NDK_MODULE_PATH should be the directory that the C++ SDK was unzipped into.
In build_sample.sh, "${ANDROID_HOME}/tools/android"... "android" refers to android.bat of the [Android SDK]\tools folder, right? (the build.sh scripts complains that I have ANDROID_HOME wrong (ERROR: F:\Android\ADT\SDK\tools\android does not exist), but android.bat exists there...
Might be a windows vs. non-windows issue. can you try copying android.bat to android and see if still works? I'll look into later today for a more permanent solution.
Likely Windows... so I guess it was not tested on Windows?
I had to make these changes to make the script building (however, it looks like it still does not produce any lib nor apk yet):
declare -r required_paths=( \
"${ANDROID_HOME}/tools" \
declare -r android_tool="${ANDROID_HOME}/tools/android.bat"
output from build.sh:
Building... /bin/sh: mount : command not found /bin/sh: tr : command not found /bin/sh: awk : command not found
Ugh - it does look the script is not windows friendly. I'll take a look as soon as I can.
Did you get this working?
Using Android Studio, yes. That was not an issue building it (after MANY guesses & try), but the sample application was crashing with UnsatisfiedLinkError exception (library not found)... which led me to try all kind of workarounds. At last I had to modify ButtonClickerNativeActivity.java to make it work...
The following worked for me:
gpg-cpp-sdk
folder should be in the same folder containing the samples-android
folder.Set the path to the Android SDK
set ANDROID_HOME=C:\Users
Add the SDK to your path
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
Set the path to the Android NDK
set ANDROID_NDK_HOME=C:\Users
(Optional) On some versions of Windows it is helpful to map the samples folder to a shortened path.
subst C:
Execute the build script
G: gradlew.bat sync gradlew.bat assemble
The How-to run a sample says that the developper must download the Google Play Game Services C++ SDK and unzip it to the ./gpg-cpp-sdk directory.
I'm sorry that I cannot figure out where that folder should go...
Thanks for clarifying this instruction for me.