一般在copy别人的项目中会easy出现本错误,截图例如以下:

出现本错误的一般有两种情况

第一种情况:导包错误--检查import,找到这个:

删除之,再又一次导入含有包名的R文件。

另外一种情况:本情况应该更为多见。一般为布局文件里有错误,而无法生存R文件。能够检查一下:

你会发现果真没有生成R文件。这时你须要解决的就是查找布局文件里的错误,改正错误,生成R文件之后,本错误就会消失啦!

喜欢的朋友关注我的微信平台哦!

很多其它好的文章推荐给你!

Android错误之--activity_main cannot be resolved or is not a field的更多相关文章

  1. android 错误收集

    2. is not translated in Eclipse > Preference > Android > Lint Error Checking的Correctness: M ...

  2. Gradle DSL method found: ‘android()’错误

    Gradle DSL method found: ‘android()’错误 和上个错误一样这个也是因为在新版本的Gradle中android()方法已经废弃,但是要注意android()只是在整个项 ...

  3. 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 ...

  4. 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 ...

  5. Android - 错误:"No resource found that matches the given name android:Theme.Material"

    Android - 错误:"No resource found that matches the given name android:Theme.Material" 本文地址:  ...

  6. Andrion错误解决:cannot be resolved or is not a field

    cannot be resolved or is not a field   解决这个问题:   选择project菜单中的clean,选择你的项目,先clean一下, 再去看看Activity中有没 ...

  7. layout cannot be resolved or is not a field

    去除代码activity代码页面顶部中的 import android.R;这句就可以消除红色波浪线的main cannot be resolved or is not a field类似这个错误了

  8. "cannot be resolved or is not a field"问题解决 (转载)

    转自:http://blog.csdn.net/liranke/article/details/16803295 在修改了资源文件后,出现“"cannot be resolved or is ...

  9. 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 ...

随机推荐

  1. gdb signal 转

    信号是一种软中断,是一种处理异步事件的方法.一般来说,操作系统都支持许多信号.尤其是UNIX,比较重要应用程序一般都会处理信号.UNIX定义了许 多信号,比如SIGINT表示中断字符信号,也就是Ctr ...

  2. Visio显示不完整

    下面显示不完整的话,选中对象,菜单栏设置(点击对象,右键并没有段落选项)行距为单倍:右侧显示不完整,选中后右键设置环绕方式为负于文字上方,原来是嵌入型.

  3. 怎样打开查看mysql binlog

    1 在my.ini(window)配置文件里面 [mysqld]log-bin=mysql-bin(名字可以随便起) 我们每次进行操作的时候,File_size都会增长 2.show binlog e ...

  4. TensorFlow------读取CSV文件实例

    TensorFlow之读取CSV文件实例: import tensorflow as tf import os def csvread(filelist): ''' 读取CSV文件 :param fi ...

  5. http://www.ruanyifeng.com/blog/2013/07/gpg.html

    http://www.ruanyifeng.com/blog/2013/07/gpg.html

  6. [CF 276C]Little Girl and Maximum Sum[差分数列]

    题意: 给出n项的数列A[ ], q个询问, 询问 [ l, r ] 之间项的和. 求A的全排列中该和的最大值. 思路: 记录所有询问, 利用差分数列qd[ ], 标记第 i 项被询问的次数( 每次区 ...

  7. mybatis paramType String Error

    我这么写的 <select id="getHotPlayersByDate" parameterType="java.lang.String" resul ...

  8. [ES6] 11. String Templates

    ECMAscript 6 lets us use string templates to gain a lot more control over strings in JavaScript. var ...

  9. 动态网站技术CGI

    递信息的规程.CGI规范允许Web服务器执行外部程序,并将它们的输出发送给Web浏览器,CGI将Web的一组简单的静三种主流的动态网站技术: ASP JSP PHP 除之外,此还要了解的动态网站技术 ...

  10. vue - check-versions.js for child_process

    webpack之类的配置文件. webpack.base.conf.js