我开始收到这个阻止我构建项目的错误
3:11:08 PM Gradle sync started
3:11:12 PM Gradle sync completed
3:11:13 PM Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
3:12:51 PM Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
3:12:53 PM Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
3:12:54 PM Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
3:12:56 PM Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
3:13:31 PM Gradle build finished in 2m 19s 29ms
在事件日志中。我看过其他问题...使缓存无效/重新启动没有做任何事情,也没有添加
android {
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
}
在我的 build.gradle 中。 我看了一些其他资源,说这个错误可能与错误的图像文件有关?我最近添加了一个 .png,但我已经尝试关闭 AS > 删除图片 > 将其重新添加到可绘制对象 > 启动 AS > 清理项目。但这似乎也无济于事。
如果有人有任何其他想法或在此之前解决了这个问题,我将不胜感激....这已经阻碍了我一段时间的进步。谢谢!!
最佳答案
我遇到了同样的问题,就像您的情况一样,上述解决方案均无效。
我的问题是,当我尝试将 strings.xml 中声明的值与 TextView 的 android:text 字段相关联时,我没有点击。此错误点击导致字符串与 android:tools 相关联。
结果是一样的:IndexNotReadyException。
一旦我从 xml 中删除了 android:tools,错误就消失了。最让我感到困惑的是,我可以在我的手机上构建和部署应用程序,即使 android:tools 并不存在(至少在 TextView 上下文中不存在)。
我建议遇到此错误的任何人检查 UI 的最新更改并仔细检查关联的 .xml。错误并不总是以红色字母突出显示,有时您必须将鼠标悬停在它上面才能显示文本“Unkown attribute:...”。
关于Android Studio - 请根据 com.intellij.openapi.project.IndexNotReadyException 文档更改调用者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42658658/