--- a/runtime/string_functions.cpp
+++ b/runtime/string_functions.cpp
@@ -7,6 +7,10 @@
 #include <clocale>
 #include <sys/types.h>
 
+#ifdef __ANDROID__
+#include <sys/endian.h>
+#endif
+
 #include "common/macos-ports.h"
 #include "common/unicode/unicode-utils.h"
 
