diff --git a/jenkins-sflphone-android.sh b/jenkins-sflphone-android.sh
index 89bea2f958b84d91da00910f6671bc8602f11f94..42bdc98024a3443e9b61f1cb00a6908cb690c52c 100755
--- a/jenkins-sflphone-android.sh
+++ b/jenkins-sflphone-android.sh
@@ -107,6 +107,10 @@ launch_emulator() {
 }
 
 build_sflphone_android() {
+    echo "Cleaning git tree"
+    # get rid of any local modifications to git submodule
+    git submodule update
+    git clean -dfx
     # android update project --target $VIRTUAL_DEVICE_ID --path $ANDROID_PROJECT_PATH
     echo "Compile pjandroid stack"
     pushd jni/pjproject-android/