我安装了android studio ..它工作正常。现在突然之间,没有一个自动完成功能正在工作。我可以在任何地方输入任何内容,没有变量检查,没有功能帮助或检查任何东西。我仍然可以编译项目,但发生这种情况时会出错。
谁能帮我解决这个问题。
我安装了android studio ..它工作正常。现在突然之间,没有一个自动完成功能正在工作。我可以在任何地方输入任何内容,没有变量检查,没有功能帮助或检查任何东西。我仍然可以编译项目,但发生这种情况时会出错。
谁能帮我解决这个问题。
前往File> Invalidate Caches / Restart... > 点击Invalidate an Restart
这真的对我有用。
来源:https ://code.google.com/p/android/issues/detail?id=61844#c4
您还可以检查文件菜单上的省电模式是否被禁用。
关闭 Android Studio 转到 C:\Users\UserName.android 并重命名文件夹:
转到 C:\Users\UserName.AndroidStudio3.x\system 或(Android studio 4 及更高版本)转到 C:\Users\UserName\AppData\Local\Google\AndroidStudio4.x 并重命名这些文件夹:
缓存到 caches_old
编译器到 compiler_old
compile-server 到 compile-server_old
转换为conversion_old
external_build_system 到 external_build_system_old
框架到 frameworks_old
gradle 到 gradle_old
resource_folder_cache 到 resource_folder_cache_old
打开 Android Studio 并再次打开您的项目。
关闭 Android Studio
转到 c_users_path_on_windows/.AndroidStudio3.5/system/
删除cache
文件夹
启动 Android Studio
这对我有用。
I have not run into this problem personally, but try checking the following settings (File
-> Settings
or Alt+F7
):
Project Settings [name]
Inspections
- ensure that Android
and Android Lint
is checked, or alternately just set it back to default using the dropdown box at the top.
IDE Settings
Editor
-> Code Completion
- ensure the Autopopup code completion
is checked (and check the rest of the settings based on your preference.
我有一个类似的问题,其他解决方案都不起作用。
关闭 Android Studio,然后删除 .idea 和 build 文件夹解决了这个问题。
如果没有任何效果(就像我发生的那样),请转到 %userprofile% 窗口中的用户配置文件。您会在那里找到(隐藏)文件夹,这些文件夹以您正在使用的 android studio 版本命名,并以点为前缀。
像.AndroidStudio3.1。把那个删掉就行了。
它正在工作
禁用省电模式
取消勾选省电模式选项:: 文件 -> 省电模式
只需删除所有名为AndroidStudioPreview
在 Windows 上:
转到您的用户文件夹 - 在 Windows 7/8 上,这将是:
[SYSDRIVE]:\Users[your username] (ex. C:\Users\JohnDoe)
在这个文件夹中应该有一个名为.AndroidStudioPreview
在 Mac OS X 上
删除这些文件:
~/Library/Application Support/AndroidStudioPreview
~/Library/Caches/AndroidStudioPreview
~/Library/Logs/AndroidStudioPreview
~/Library/Preferences/AndroidStudioPreview
android studio中有一个省电模式,如果你不小心点击了,它将禁用代码分析,这将减少电池消耗,性能也会提高,但它不会检测到任何错误并自动完成操作。
禁用节电模式
- Go to File Menu of Studio
- Uncheck The Power Saver Mode
在您的 IDE 中,代码分析将使用您的 android studio 右上角的眼睛符号显示。
If Green means it is enabled and there is no error in your code.
If Red Means It is enabled but there are few errors in your code.
If It is white or blur then code analysis is disabled
适用于 Artic Fox 2020|3.1 版本:自动完成建议问题。
请按照以下步骤操作:
关闭 Android Studio
在 C:\Users{username}\AppData\Local\Google\AndroidStudio2020.3 中找到缓存文件夹并将其删除。再次打开 Android Studio。
检查您的 Android Studio 版本并将该版本文件夹定位在以下位置 C:\Users{username}\AppData\Local\Google
注意:AppData 文件夹在 Windows 中是隐藏的
如果 android studio 弄乱了 xml 文件和 java 代码,这个解决方案也可以工作。不!修改您的代码,否则 IDE 将无法将其更改为默认值。如果您看到如此凌乱的代码,只需按照上述步骤操作,您的代码就会再次正常。
就我而言,当我将键盘语言切换为英语时,自动完成功能再次起作用。
如果自动完成在 Android Studio 中不适合您,只需按 File 并取消选中省电模式,之后它应该可以正常工作。如果已取消选中省电模式,则首先检查然后取消选中它们。
如果您包含一个库项目,请确保该库具有build.gradle
使用配置列出的依赖项api
,而不是implementation
配置。还要确保包含库的项目列出了所有依赖项(在implementation
这里使用配置很好)。
'The file size (2561270 bytes) exceeds configured limit (2560000 bytes). Code insight features are not available.'
在添加一行代码后最终在选项卡下以黄色显示此消息之前,这些建议的解决方案都没有工作好几天。删除代码行消除了消息,但没有消除问题。似乎有一个代码大小窗口,您会失去洞察功能但没有收到此消息,至少对我而言。一旦你超过某个点,消息最终会弹出。针对此问题,在另一个线程中建议的解决方案是编辑“帮助/编辑自定义属性”以增加配置的限制,但只是打开它会弹出一个对话框,询问我是否要创建一个“idea.properties”文件夹,所以我决定不要为了最终削减文件大小而冒险使用这种方法。
可能有几件事导致这种情况。
targetSdkVersion
和中写入了正确的版本compileSdkVersion
。targetSdkVersion
和compileSdkVersion
相同。其他解决方案可以是:
File
→重新启动 Android StudioInvalidate Caches / Restarts...
Build
从→清理您的项目Clean Project
Build
从→重建项目Rebuild Project
Build
从→制作项目Make Project
[此过程可能需要一些时间]到目前为止,我多次遇到此问题,我建议您采用以下方法:
1-如所说检查省电模式
2-创建具有相同应用程序ID和包名称的新项目,并将所有源和资源从旧项目复制到新项目,
我在 mac 上将 kotlin 库添加到我的项目中时遇到了这个问题。将macbook语言更改为英文解决了这个问题。我在自动生成的数据绑定代码方面也遇到了一些奇怪的问题,这些问题也得到了解决。
从菜单中选择:File->Invalidate Catches/Restart...
比在打开的对话框中选择:“无效并重新启动”并等待重新启动 android studio。
尝试从 android studio 的菜单栏中的文件使缓存/重新启动无效。
如果有时如果您拼错文件扩展名或在未添加扩展名的情况下创建文件,则会出现此问题。检查您是否已正确添加文件扩展名。
我认为这个答案可能会对你有所帮助。
Simpy 在重新启动 Android 工作室后它对我有用。
在我的情况下, C:\Users\UserName\AppData\Local\Google\AndroidStudio2020.3\ 只需删除缓存文件夹并重新启动 android studio。删除此缓存文件夹后,我的问题解决了:)
I had the same problem for a while now. Until I searched through the Android Studio site and bumped with the introduction. Then I found how to activate (I think) the autocomplete feature. It says press Control+Space and when I did, it worked.