How do I disable Wildcard imports for all Kotlin files in Android Studio?

You can set your Android Studio preferences to remove all wildcard imports from Kotlin files.

  1. Open Android Studio Preferences: Editor > Code Style > Kotlin
  2. Select Use single name import for Top-level Symbols
  3. Select Use single name import for Java Statics and Enum Members
  4. Remove all packages from Packages to Use Import with by clicking the minus - symbol until it says Nothing to show

For each Kotlin file, you can fix imports with Code > Optimize Imports (shortcut ⌃⌥O on Mac).

Screenshot of Android Studio 4.1.2 Settings: No Kotlin Wildcard Imports

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)