java 无法解析android符号-android应用程序-intelliJ
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17262823/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
cannot resolve android symbol - android app - intelliJ
提问by user1611830
I am using intellij-idea to develop android app. I created a project with an android module, but none of these :
我正在使用 intellij-idea 开发 android 应用程序。我创建了一个带有 android 模块的项目,但这些都不是:
import android.app.Activity;
import android.os.Bundle;
are recognized, I get cannot resolve android symbol
. I googled this issue but none of the remarks I found there seems to debugg my problem
被认可,我明白了cannot resolve android symbol
。我用谷歌搜索了这个问题,但我在那里发现的评论似乎都没有调试我的问题
回答by Dilini
What you should do is,
你应该做的是,
1. Select your android project 2. press ctrl +alt + shift + S 3. Select SDK from the project settings 4. Check the files under the class path tab 5. There must be android.jar ,res ,annotations.jar Probably there should be missed one or several files in step 5. Then, 6. Go to Android SDK home path field and add your SDK folder again files even though you have all the jars and still you are getting the error ,then remove all the jars from the class path and add them again ( like in step 6). 7. Build menu -?Rebuild your project.
Now your errors should disappear.
现在你的错误应该消失了。
回答by FAHAD HAMMAD ALOTAIBI
i have the answer guys
1- press ctrl+alt+shift+s
2-in the Modules bar click on your project name
3-change the compile sdk version to the newest one
4-click apply and ok then sync your project
5-done , i hope the best for you
我有答案
1-按 ctrl+alt+shift+s
2-在模块栏中单击您的项目名称
3-将编译 sdk 版本更改为最新版本
4 单击应用并确定然后同步您的项目
5-完成, 我希望对你最好
回答by MAOXU
Basically, this is because you didn't add Android SDK. So you need to add android SDK.
基本上,这是因为您没有添加Android SDK。所以你需要添加android SDK。
- go to Files and select project structure.
- go to project and select the project SDK
- click New and select Android SDK version
- 转到文件并选择项目结构。
- 转到项目并选择项目 SDK
- 单击新建并选择 Android SDK 版本