diff --git a/xwords4/android/XWords4/build.xml b/xwords4/android/XWords4/build.xml
index 9fd5842ec..77ee42d42 100644
--- a/xwords4/android/XWords4/build.xml
+++ b/xwords4/android/XWords4/build.xml
@@ -51,6 +51,9 @@
+
+
+
@@ -62,6 +65,10 @@
+
+
+
+
diff --git a/xwords4/android/scripts/ndksetup.sh b/xwords4/android/scripts/ndksetup.sh
new file mode 100755
index 000000000..304255284
--- /dev/null
+++ b/xwords4/android/scripts/ndksetup.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -u -e
+
+APPMK=./jni/Application.mk
+XWORDS_DEBUG_ARMONLY=${XWORDS_DEBUG_ARMONLY:-""}
+
+echo "# Generated by $0; do not edit!!!" > $APPMK
+
+if [ "$1" = "release" ]; then
+ echo "APP_ABI := armeabi x86" >> $APPMK
+elif [ -n "$XWORDS_DEBUG_ARMONLY" ]; then
+ echo "APP_ABI := armeabi" >> $APPMK
+else
+ echo "APP_ABI := armeabi x86" >> $APPMK
+fi