1diff --git a/src/lib.rs b/src/lib.rs
2index 935e432..7e87795 100644
3--- a/src/lib.rs
4+++ b/src/lib.rs
5@@ -275,7 +275,8 @@
6 //!
7 //! Users should generally avoid defining a flag with a value of zero.
8
9-#![cfg_attr(not(test), no_std)]
10+// ANDROID: Use std to allow building as a dylib.
11+#![cfg_attr(not(any(test, android_dylib)), no_std)]
12 #![doc(html_root_url = "https://docs.rs/bitflags/1.3.2")]
13
14 #[doc(hidden)]
15