diff --git a/xwords4/android/XWords4/build.xml b/xwords4/android/XWords4/build.xml
index b1d8ad988..d1536010c 100644
--- a/xwords4/android/XWords4/build.xml
+++ b/xwords4/android/XWords4/build.xml
@@ -61,6 +61,7 @@
diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GCMIntentService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GCMIntentService.java
index 2ab40f4bc..1fc22e503 100644
--- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GCMIntentService.java
+++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GCMIntentService.java
@@ -74,7 +74,7 @@ public class GCMIntentService extends GCMBaseIntentService {
public static void init( Application app )
{
int sdkVersion = Integer.valueOf( android.os.Build.VERSION.SDK );
- if ( 8 <= sdkVersion ) {
+ if ( 8 <= sdkVersion && 0 < GCMConsts.SENDER_ID.length() ) {
try {
GCMRegistrar.checkDevice( app );
// GCMRegistrar.checkManifest( app );
diff --git a/xwords4/android/scripts/gen_gcmid.sh b/xwords4/android/scripts/gen_gcmid.sh
index 9ca58833a..75bbb2089 100755
--- a/xwords4/android/scripts/gen_gcmid.sh
+++ b/xwords4/android/scripts/gen_gcmid.sh
@@ -1,8 +1,9 @@
#!/bin/sh
+set -e -u
+
if [ -z "$GCM_SENDER_ID" ]; then
- echo "GCM_SENDER_ID not in env"
- exit 1
+ echo "GCM_SENDER_ID empty; GCM use will be disabled" >&2
fi
cat <