reducing activity
reducing activity

Reputation: 2254

How can I stop Android Studion from assuming that Log is in com.esotericsotware.minlog.Log library?

Writing code like Log.wtf("error group", "error message") requires including import android.util.Log.

In the past import autocompletion for missing Log import included both import android.util.Log and com.esotericsotware.minlog.Log that I do not want to ever use.

Some time ago, something happened and android.util.Log got blacklisted, with only com.esotericsotware.minlog.Log appearing in the suggestion list.

I want exact opposite, with com.esotericsotware.minlog.Log gone and not presented as a suggestion.

I have Android Studio 3.5.2, checking for updates claims that it is the latest version.

Upvotes: 0

Views: 40

Answers (1)

anshajkhare
anshajkhare

Reputation: 317

There are 2 things you can try:

  • You can try excluding redundant entries from automatic import so that the list of suggestions contains only relevant items.

    1. In the Settings/Preferences dialog, click Editor | Auto Import.
    2. In the Exclude from Import and Completion section, click the Add button +, and specify a class or a package that you want to exclude. You can also select whether you want to exclude items from the current project or from all projects (globally). enter image description here
  • Otherwise, you can try disabling auto-imports in Android Studio altogether.

    1. In the Settings/Preferences dialog click Editor | General | Auto Import

    2. Unselect the Add unambiguous imports on the fly checkbox, and apply the changes.

enter image description here

You can check out the Android Studio documentation page here.

Upvotes: 1

Related Questions