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