Android Studio - 错误:无法加载类“org.slf4j.LoggerFactory" [英] Android Studio - Error:Unable to load class 'org.slf4j.LoggerFactory'
问题描述
我是 Android 世界的新手.我打开了 Android 2.2 工作室,在创建新项目后,收到此错误消息:
I'm new in the Android world. I opened studio Android 2.2 and, after creating a new project, I get this error message:
无法同步 Gradle 项目..."
错误:无法加载类org.slf4j.LoggerFactory".可能的原因对于此意外错误,包括:
- Gradle 的依赖项缓存可能已损坏(这有时发生在网络连接之后超时.)重新下载依赖项并同步项目(需要网络)
- Gradle 构建的状态进程(守护进程)可能已损坏.停止所有 Gradle 守护进程可能会解决这个问题.停止 Gradle 构建过程(需要重启)
- 您的项目可能正在使用第三方与项目中的其他插件不兼容的插件或项目要求的 Gradle 版本.
- Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
- The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
- Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
Error:Unable to load class 'org.slf4j.LoggerFactory'. Possible causes for this unexpected error include:
我该如何解决这个问题?谢谢
How can I fix the problem? Thanks
推荐答案
转到 File
-> Settings
-> 展开 Build, Execution, Deployment
-> 选择Build Tools
-> Gradle
-> 在Project Level Settings
下选择Use default gradle wrapper
.再次尝试 Gradle build,这对我有用.
Go to File
-> Settings
-> Expand Build, Execution, Deployment
-> Select Build Tools
-> Gradle
-> Under Project Level Settings
Select Use default gradle wrapper
. Try Gradle build again and this worked for me.
这篇关于Android Studio - 错误:无法加载类“org.slf4j.LoggerFactory"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!