简体   繁体   English

Android Studio-无法识别语法错误

[英]Android Studio - Not recognizing syntax errors

I've tried to Invalidate Caches/Restart and Clean Project several times. 我试图使缓存无效/重新启动和清理项目多次。

I'm running the following version of Android studio. 我正在运行以下版本的Android Studio。

Android Studio 3.2.1
Build #AI-181.5540.7.32.5056338, built on October 8, 2018
JRE: 1.8.0_152-release-1136-b06 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6

The issue is the code is not being autocorrected by the IDE and none of the code assist features are working. 问题是IDE无法自动更正代码,并且没有任何代码辅助功能。

I left some intentional errors in my code and the compiler did not output any errors. 我在代码中留下了一些故意的错误,并且编译器未输出任何错误。

I'm also getting this error whenever I open a project: 每当我打开一个项目时,我也会收到此错误:

Error while indexing /Users/christopherholmes/AndroidStudioProjects/QuizTwo/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com/example/christopherholmes/quiztwo/R.java

Not sure what to make of this. 不知道该怎么做。

EDIT So I closed and re-opened Android Studio like 3 times and now things are back to normal. 编辑所以我像3次关闭并重新打开Android Studio,现在一切恢复正常。 Crossing fingers... I will update if I run into any more issues. 交叉的手指...如果遇到其他问题,我会更新。

EDIT 编辑

The problem has returned. 问题已返回。 To attempt to solve the problem I have 为了解决我的问题

1) Upgraded Android Studio 2) Invalidated and Cleaned Cache 3) Rebuilt the project 1)升级的Android Studio 2)无效并清除了缓存3)重建了项目

I think you should check your directory of adb. 我认为您应该检查您的adb目录。 It is important to fill correct directory for studio otherwise it will create problem. 为Studio填写正确的目录很重要,否则会造成问题。 The directory will look like../Users//Library/Android/sdk/platform-tools..This is default directory.Make sure your adb is located in that directory. 该目录看起来像../Users//Library/Android/sdk/platform-tools ..这是默认目录。请确保您的adb位于该目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM