如何阻止 Android Studion 假定 Log 在 com.esotericsotware.minlog.Log 库中?
How can I stop Android Studion from assuming that Log is in com.esotericsotware.minlog.Log library?
像 Log.wtf("error group", "error message")
这样的代码需要包含 import android.util.Log
.
过去,缺少 Log
的导入自动完成功能包含我不想使用的 import android.util.Log
和 com.esotericsotware.minlog.Log
。
前段时间发生了一些事情,android.util.Log
被列入黑名单,只有com.esotericsotware.minlog.Log
出现在建议列表中。
我想要完全相反的东西,com.esotericsotware.minlog.Log
消失了,没有作为建议出现。
我有 Android Studio 3.5.2,检查更新声称它是最新版本。
您可以尝试 2 件事:
您可以尝试从自动导入中排除多余条目,以便建议列表仅包含相关项目。
- 在 Settings/Preferences 对话框中,单击 编辑器 |自动导入.
- 在 从导入和完成中排除 部分,单击添加按钮 +,然后指定 class 或要排除的包。
您还可以 select 是否要从当前项目或所有项目(全局)中排除项目。
否则,您可以尝试在 Android Studio 中完全禁用 auto-imports。
在 Settings/Preferences 对话框中单击 编辑器 |一般 |自动导入
取消select即时添加明确导入复选框,然后应用更改。
您可以查看 Android Studio 文档页面 here。
像 Log.wtf("error group", "error message")
这样的代码需要包含 import android.util.Log
.
过去,缺少 Log
的导入自动完成功能包含我不想使用的 import android.util.Log
和 com.esotericsotware.minlog.Log
。
前段时间发生了一些事情,android.util.Log
被列入黑名单,只有com.esotericsotware.minlog.Log
出现在建议列表中。
我想要完全相反的东西,com.esotericsotware.minlog.Log
消失了,没有作为建议出现。
我有 Android Studio 3.5.2,检查更新声称它是最新版本。
您可以尝试 2 件事:
您可以尝试从自动导入中排除多余条目,以便建议列表仅包含相关项目。
- 在 Settings/Preferences 对话框中,单击 编辑器 |自动导入.
- 在 从导入和完成中排除 部分,单击添加按钮 +,然后指定 class 或要排除的包。
您还可以 select 是否要从当前项目或所有项目(全局)中排除项目。
否则,您可以尝试在 Android Studio 中完全禁用 auto-imports。
在 Settings/Preferences 对话框中单击 编辑器 |一般 |自动导入
取消select即时添加明确导入复选框,然后应用更改。
您可以查看 Android Studio 文档页面 here。