Thanks to @ kirsh300's answer , I got a newer git libpd repo for Android, but the build process was not trivial for me. Since this is likely to remain complicated (see Android Studio "Current NDK support is deprecated and out ), below is a bash script of what I needed to do to get libpd for Android for my old Linux application.
The first problem is that my installation is done in non-standard directories. Then I used the SDK from the old (er) Android Studio Bundle for Linux, 135.1078000 (since 20140321); By default it is equal to max 19 API; and does not install other APIs by default. However, the current revision of libpd applies to both API 17 and API 21. I manually installed API 17 by calling the $ANDROID_HOME/tools/android command, which is the Android SDK Manager, and I reduced API 21 to 19 by correcting the files in the script below. So, my Android SDK manager shows for installed:

The second problem is that with this SDK, gradlew appears, which is version 1.10, and the current version of gradlew marked in the libpd repo is 2.4 (on the first call, it will try to download the correct version of gradle ). Remember that you do not need to call gradlew from the SDK because it does not understand, say, android.ndkDirectory ("Could not find the property" ndkDirectory "on com.android.build.gradle.LibraryExtension_Decorated @ 3e3c83") or variant.outputs.each ("Could not find property exits" on com .android.build.gradle.internal.api.LibraryVariantImpl_Decorated@ 97447e ") builds in build.gradle scripts - thus gradlew 2.4 from the repo (hence the relative path in the script).
Here is the script:
#!/usr/bin/env bash # wget http://dl.google.com/android/studio/install/0.5.2/android-studio-bundle-135.1078000-linux.tgz # wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86.bin # unpack downloads - and modify these to your actual absolute paths (also for JAVA_HOME below): ADTSDK=/path/to/adt-bundle-linux-x86-20140321/sdk ADNDK=/path/to/android-ndk-r10e # these seem to not really matter? nvm, keep: export ANDROID_HOME=$ADTSDK export ANDROID_NDK_HOME=$ADNDK set -x # only run if the subdirectory pd-for-android not created yet: if [ ! -d "pd-for-android" ]; then #git clone https://github.com/libpd/pd-for-android.git # no, OLD! git clone https://github.com/tkirshboim/pd-for-android.git cd pd-for-android # checkout specific version to make sure this test works when the repo changes: git checkout -f c5ea734c5aac7f2d37141e287bd0102706d54e55 # create root/top-level local.properties, esp. for sdk.dir: echo "ndk.dir=$ADNDK" > local.properties echo "sdk.dir=$ADTSDK" >> local.properties # downgrade API version: sed -i 's_compileSdkVersion 21_compileSdkVersion 19 //21_' PdTest/build.gradle sed -i 's_buildToolsVersion "21.1.2"_buildToolsVersion "19.1" //"21.1.2"_' PdTest/build.gradle sed -i "s_targetSdkVersion 21_targetSdkVersion 19 //21_" PdTest/build.gradle sed -i 's_compileSdkVersion 21_compileSdkVersion 19 //21_' CircleOfFifths/build.gradle sed -i 's_buildToolsVersion "21.1.2"_buildToolsVersion "19.1" //"21.1.2"_' CircleOfFifths/build.gradle sed -i "s_targetSdkVersion 21_targetSdkVersion 19 //21_" CircleOfFifths/build.gradle sed -i 's_compileSdkVersion 21_compileSdkVersion 19 //21_' ScenePlayer/build.gradle sed -i 's_buildToolsVersion "21.1.2"_buildToolsVersion "19.1" //"21.1.2"_' ScenePlayer/build.gradle sed -i "s_targetSdkVersion 21_targetSdkVersion 19 //21_" ScenePlayer/build.gradle sed -i 's_compileSdkVersion 21_compileSdkVersion 19 //21_' Voice-O-Rama/build.gradle sed -i 's_buildToolsVersion "21.1.2"_buildToolsVersion "19.1" //"21.1.2"_' Voice-O-Rama/build.gradle sed -i "s_targetSdkVersion 21_targetSdkVersion 19 //21_" Voice-O-Rama/build.gradle cd PdCore sed -i 's_compileSdkVersion 21_compileSdkVersion 19 //21_' build.gradle sed -i "s_buildToolsVersion '21.1.2'_buildToolsVersion '19.1' //'21.1.2'_" build.gradle # The SDK Build Tools revision (19.0.3) is too low for project ':PdCore'. Minimum required is 19.1.0 - install via Android SDK manager sed -i "s_targetSdkVersion 21_targetSdkVersion 19 //21_" build.gradle # check if tasks pass: ../gradlew tasks || { echo 'tasks failed' ; exit 1; } # pulls gradle-2.4-all.zip; # build: # must specify JAVA_HOME here, else "FAILURE: Build failed ... Could not find tools.jar" JAVA_HOME=/path/to/jdk1.6.0_45 ../gradlew assembleRelease cd ../.. fi
sdaau source share