diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
index ab851bd648257c8c386ca8f037ad9ab5d5d284b1..8ae1b8881ae33f0e4ff750fc50f21dcfab6ef051 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
@@ -24,7 +24,6 @@ import android.util.AttributeSet;
 import android.util.Log;
 import android.util.TypedValue;
 import android.util.Xml;
-import android.view.InflateException;
 
 import com.android.inputmethod.annotations.UsedForTesting;
 import com.android.inputmethod.keyboard.Key;
@@ -750,7 +749,7 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
 
     private void endRow(final KeyboardRow row) {
         if (mCurrentRow == null) {
-            throw new InflateException("orphan end row tag");
+            throw new RuntimeException("orphan end row tag");
         }
         if (mRightEdgeKey != null) {
             mRightEdgeKey.markAsRightEdge(mParams);