简体   繁体   English

Android Studio无法识别基本包,例如String或Integer'Cannot Resolve Symbol…'

[英]Android Studio not recognizing base packages such as String or Integer 'Cannot Resolve Symbol …'

My Android Studio no longer recognizes basic embedded packages such as Strings and Integers. 我的Android Studio不再识别基本的嵌入式程序包,例如Strings和Integers。

This is something that occurs across any projects so it may not have to do with code. 这是所有项目中都会发生的事情,因此可能与代码无关。

I have tried looking into the JDK however nothing has changed with it and it used to work okay in the past. 我曾尝试研究JDK,但是它并没有改变,过去它还可以正常工作。 I have also tried Invalidate and Restart which is the most used tool for miscellaneous issues. 我也尝试过Invalidate and Restart,这是解决其他问题最常用的工具。

Seems like the Java kit is misplaced because this is for all basic types String, Integers, Objects... 似乎Java工具包放错了位置,因为这适用于所有基本类型的String,Integers,Objects ...

Any suggestions are helpful. 任何建议都是有帮助的。

Try the following: 请尝试以下操作:

  1. Open up Android Studio to the welcome screen where you can select projects 将Android Studio打开到欢迎屏幕,您可以在其中选择项目
  2. Click on Configure in the lower right corner 单击右下角的Configure
  3. Click on Project Defaults and then click on Project Structure 单击Project Defaults ,然后单击Project Structure
  4. Click on the checkbox Use Embedded JDK (Recommended) 单击“ Use Embedded JDK (Recommended) ”复选框Use Embedded JDK (Recommended)
  5. Click OK 点击OK

That will use the Android Studio embedded JDK instead of a configured one. 它将使用Android Studio嵌入式JDK而不是已配置的JDK。

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

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