一般在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. <摘录>简述configure、pkg-config、pkg_config_path三者的关系

    一.什么是configure 源码安装过程中大多会用到configure这个程序,一般的configure都是一个script,执行时可以传入必要参数告知配置项目. configure程序它会根据传入 ...

  2. ms_sql_server_architecture

    We have classified the architecture of SQL Server into the following parts for easy understanding − ...

  3. all objects of the same class share the same set of class methods

    #include <iostream> #include "First.h" void Test(); int main() { std::cerr<<&q ...

  4. C# Sftp操作

    SFTP释义-----引自百度百科 sftp是Secure File Transfer Protocol的缩写,安全文件传送协议.可以为传输文件提供一种安全的网络的加密方法.sftp 与 ftp 有着 ...

  5. 关于 js 中的回调函数 callback

    本文写于1年前 曾经的学习文章如今拿出来分享 前言 其实我一直很困惑关于js中的callback,困惑的原因是,学习中这块看的资料少,但是平时又经常见,偶尔复制一下前人代码,功能实现了也就不再去追其原 ...

  6. mormot日志

    mormot日志 usesSynLog; if log = nil then // 日志 begin log := TSynLog.Add; log.Family.DestinationPath := ...

  7. 二十四种设计模式:模板方法模式(Template Method Pattern)

    模板方法模式(Template Method Pattern) 介绍定义一个操作中的算法的骨架,而将一些步骤延迟到子类中.Template Method使得子类可以不改变一个算法的结构即可重定义该算法 ...

  8. ylbtech-LanguageSamples-PythonSample

    ylbtech-Microsoft-CSharpSamples:ylbtech-LanguageSamples-PythonSample 1.A,示例(Sample) 返回顶部 本示例演示如何使用 C ...

  9. [转]SQL Server表分区

    本文转自:http://www.cnblogs.com/knowledgesea/p/3696912.html 什么是表分区 一般情况下,我们建立数据库表时,表数据都存放在一个文件里. 但是如果是分区 ...

  10. cmake处理多源文件目录的方法

    cmake处理源代码分布在不同目录中的情况也很简单,现在假设我们的源代码分布情况如下: 源代码的分布情况 其中src目录下的文件要编译成一个链接库 第一步,项目主目录中的CMakelist.txt 在 ...