英文:
Android Studio cannot resolve method after Importing a Project
问题
我是Android Studio环境中的新手。我的IDE版本是Android Studio Electric Eel | 2022.1.1 Patch 1。我一直无法解决这个问题。最近,我被分配到一个已经开发好的Android Studio项目。因此,我从git上下载了它。但在打开它后,Android Studio显示了大量相同类型的错误。
IDE无法解析其他类的函数或变量,这些函数或变量与get和set函数一起使用。
更令我困惑的是,当我运行'app'时,它可以成功构建和运行。
提前感谢。
我已经使缓存无效,重新启动了IDE,丢弃了整个项目,然后再次从git上下载。但这些错误还是没有消失。
英文:
I am new in Android Studio environment. My IDE Version is Android Studio Electric Eel | 2022.1.1 Patch 1. I have been unable to fix this issue for quite some time. I was recently assigned to an already developed Android Studio Project. So, I downloaded it from the git. But after opening it, Android Studio is showing me loads of errors of same type.
The IDE cannot resolve other class's functions or variables which are used with get and set function.
What is even more confusing to me, when I run the 'app' it builds and runs successfully.
Thanks in advance.
I have Invalidated Caches, Restarted IDE, discarded the whole project and again downloaded from git. But these errors are not going away.
答案1
得分: 0
我遇到了这个问题。
不要担心。问题实际上是Lombok插件。Android Studio的最新版本不支持它。
以下是您需要做的:
- 转到以下网址:https://plugins.jetbrains.com/plugin/6317-lombok/versions
- 查看最新版本并下载。
- 将其解压缩到您的下载目录中。
- 然后复制包含“lombok-plugin”文件夹并粘贴到Android Studio/plugins目录中。
- 使缓存无效(可选)。
- 重新启动IDE。
希望有所帮助。
英文:
I have faced this problem.
Do not worry. The problem is actually the Lombok Plugin. Android Studio's latest versions do not support it natively.
Here is what you need to do:
- Go to this URL:
https://plugins.jetbrains.com/plugin/6317-lombok/versions - Check out the latest version and download.
- Unzip it in your Downloaded Directory.
- Then copy the containing "lombok-plugin" folder and paste it to
Android Studio/plugins directory. - Invalidate Cache (Optional)
- Restart IDE
Hope it helps.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论