Android错误之--activity_main cannot be resolved or is not a field
一般在copy别人的项目中会easy出现本错误,截图例如以下:
出现本错误的一般有两种情况
第一种情况:导包错误--检查import,找到这个:
删除之,再又一次导入含有包名的R文件。
另外一种情况:本情况应该更为多见。一般为布局文件里有错误,而无法生存R文件。能够检查一下:
你会发现果真没有生成R文件。这时你须要解决的就是查找布局文件里的错误,改正错误,生成R文件之后,本错误就会消失啦!
喜欢的朋友关注我的微信平台哦!
很多其它好的文章推荐给你!
Android错误之--activity_main cannot be resolved or is not a field的更多相关文章
- android 错误收集
2. is not translated in Eclipse > Preference > Android > Lint Error Checking的Correctness: M ...
- Gradle DSL method found: ‘android()’错误
Gradle DSL method found: ‘android()’错误 和上个错误一样这个也是因为在新版本的Gradle中android()方法已经废弃,但是要注意android()只是在整个项 ...
- Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app
出现的问题: Error:Execution failed for task ':app:preDebugAndroidTestBuild'.> Conflict with dependency ...
- Conflict with dependency 'com.android.support:support-annotations' in project ':xxx'. Resolved versions for app (25.4.0) and test app (27.1.1) differ 问题解决
Conflict with dependency 'com.android.support:support-annotations' in project ':xxx'. Resolved versi ...
- Android - 错误:"No resource found that matches the given name android:Theme.Material"
Android - 错误:"No resource found that matches the given name android:Theme.Material" 本文地址: ...
- Andrion错误解决:cannot be resolved or is not a field
cannot be resolved or is not a field 解决这个问题: 选择project菜单中的clean,选择你的项目,先clean一下, 再去看看Activity中有没 ...
- layout cannot be resolved or is not a field
去除代码activity代码页面顶部中的 import android.R;这句就可以消除红色波浪线的main cannot be resolved or is not a field类似这个错误了
- "cannot be resolved or is not a field"问题解决 (转载)
转自:http://blog.csdn.net/liranke/article/details/16803295 在修改了资源文件后,出现“"cannot be resolved or is ...
- matlab里textread出现错误“Trouble reading floating point number from file (row 1, field 1)”
matlab里textread出现错误“Trouble reading floating point number from file (row 1, field 1)” 解决办法:traindata ...
随机推荐
- mysql原创博客
http://blog.itpub.net/15480802/viewspace-1755100/
- 一种计算MD5的实现方法
1.在需要用到加密的地方可以使用.net中的md5相关的类生成md5给文件加密. 2.基本思路: 将文件也好,字符串也好,转成字节数组,再利用.net的md5相关类生成md5相关字符串,再将字符串转成 ...
- java gzip压缩与解压
import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOExceptio ...
- 使用神经网络识别手写数字Using neural nets to recognize handwritten digits
The human visual system is one of the wonders of the world. Consider the following sequence of handw ...
- Selenium IDE 基础使用教程
Selenium IDE 基础使用教程 简介及安装 Selenium IDE 是一个易于使用的Firefox插件.它提供了一个图形用户界面,可进行脚本录制及导出.其记录的脚本可以被转换成多种编程语言( ...
- Java中设置classpath、path、JAVA_HOME的作用?
1.classpath是用来找编译后的class文件的,操作系统或者编译器等会在这些目录下寻找对应的.class文件 2.path时用来找命令行执行文件的,操作系统或者其他软件会在这些目录下找对应的命 ...
- oracle 10g函数大全--字符型函数
ASCII(x1) [功能]:返回字符表达式最左端字符的ASCII 码值. [参数]:x1,字符表达式 [返回]:数值型 [示例] SQL> select ascii('A') A,ascii( ...
- decal in unity
// Upgrade NOTE: commented out 'float4x4 _CameraToWorld', a built-in variable// Upgrade NOTE: replac ...
- solr 自聚类实现
参考官网:https://lucene.apache.org/solr/guide/6_6/result-clustering.html 最近用到solr自聚类的,先简单介绍如下: 1.配置文件 主要 ...
- pyspider介绍及安装
一.pyspider简介 1.通过python脚本进行结构化信息的提取,follow链接调度抓取控制,实现最大的灵活性 2.通过web化的脚本编写.调试环境.web展现调度状态 3.抓取环模型成熟稳定 ...