1diff --git a/src/lib.rs b/src/lib.rs
2index d28fd87..35eabca 100644
3--- a/src/lib.rs
4+++ b/src/lib.rs
5@@ -420,7 +420,8 @@
6 //! For details on exactly what's generated for it, see the [`Field0`](example_generated/struct.Field0.html)
7 //! example docs.
8
9-#![cfg_attr(not(any(feature = "std", test)), no_std)]
10+// ANDROID: Use std to allow building as a dylib.
11+#![cfg_attr(not(any(feature = "std", test, android_dylib)), no_std)]
12 #![cfg_attr(not(test), forbid(unsafe_code))]
13
14 #![doc(html_root_url = "https://docs.rs/bitflags/2.2.1")]
15