1. 程式人生 > >報出現“"cannot be resolved or is not a field",

報出現“"cannot be resolved or is not a field",

出現“"cannot be resolved or is not a field",是因為當前java類的匯入不是當前專案的R檔案 ,而是匯入了Android.R檔案。

解決:找到對應報錯誤的類,刪除java程式碼中的”import Android.R“(在類匯入部分)。然後匯入專案R檔案即可

相關推薦

出現“"cannot be resolved or is not a field"

出現“"cannot be resolved or is not a field",是因為當前java類的匯入不是當前專案的R檔案 ,而是匯入了Android.R檔案。 解決:找到對應報錯誤的類,刪除java程式碼中的”import Android.R“(在類匯入部分)。

Androidannotation 錯:cannot be resolved or is not a field

我今天終於解決這個問題,  專案應用了androidannotation,以註解方式編寫程式碼,很快很順暢。。。。。 寫著寫著,突然報了:cannot be resolved or is not a

Android中cannot be resolved or is not a field錯誤的解決辦法

以下問題可以參考: 1.R cannot be resolved or is not a field 2.id cannot be resolved or is not a field 在寫第一程式的時候,遇到了這個錯誤,我在引用一個變數時,ListView myList

Eclipse Android專案 為控制元件添加了Id但是在Java程式碼中提示xxx cannot be resolved or is not a field

在Android開發過程中,常需要在佈局檔案中為控制元件新增Id,以便在Java程式碼中找到這個控制元件。 但在使用Eclipse進行開發的過程中,常會出現明明已經在Layout XML檔案中為元件添

解決使用maven的java web項目導入後出現的有關問題 -cannot be read or is not a valid ZIP file

valid 鏡像 項目 bsp 阿裏 可能 錯誤 mini java 錯誤問題:雖然查找repository目錄下是有jar包,但是jar包是有問題的(可能是下載不完整),所以更改鏡像地址到國內。 解決方案: 1)刪除提示錯誤路徑下的所有jar包(C:

解決java web專案匯入後出現的有關問題 -cannot be read or is not a valid ZIP file

解決java web專案匯入後出現的問題 —cannot be read or is not a valid ZIP file   今天匯入以前的2個web專案後會出現以下三個錯誤:   1. Archive for required library: ‘W

Maven工程中提示:Archive for required library...cannot be read or is not a valid ZIP file

Problem Description I create maven project in Eclipse. Then I got some problems in Markers tab: Solution 1. Enter the directory mentioned in

Archive for required library: ‘WebContent/WEB-INF/lib/xxx.jar cannot be read or is not Zip file

         今天匯入一個專案到eclipse,出現感嘆號,而且報1. Archive for required library: ‘WebContent/WEB-INF/lib/xxxxx.jar cannot be read or is not a valid ZI

git 拉取遠程分支錯(fatal: '' is not a commit and a branch '' cannot be created from it)

fatal pull com gin -s sta can check 問題 問題描述從遠程git上拉取某一個分支,然後報錯,拉取不了這個分支。 拉取分支的命令: git checkout -b xxx-static-19 origin/xxx-static-19其中xx

在寫反射的時候myeclipse錯The type javax.servlet.ServletContext cannot be resolved. It is indirectly referen

public class MyReflect {public String className = null;public Class personClass= null;@Beforepublic void init() throws ClassNotFoundExcep

The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files

it is miss ati refers () imp -s tar pre 問題描述 Exception in thread "main" java.lang.Error: Unresolved compilation problems: The t

Eclipse裏Tomcat錯:Document base ……does not exist or is not a readable directory

str doc tomcat的配置 metadata tom com tor tro 路徑和 如標題所述 在eclipse中導入工程運行時提示 目錄不存在。 解決辦法: 檢查eclipse 中tomcat的配置發布路徑和 conf/server.xml 中的發布路徑

jsp出現cannot be resolved 問題

ima 是否 abc getname 問題 刪掉 分享圖片 href tomcat6 今天接手一個09年的老項目,這個項目是Struts2的,早就忘光了,配置文件也一大堆,廢了老大勁解決出現的錯誤,跑起來了,登錄成功後跳轉到首頁出現500錯誤,報錯:“org.apache

eclipse中自建實體類存在但是導入的包cannot be resolved

nbsp lazy net 沒有 文章 using debug switch ips 摘自:https://blog.csdn.net/lazy_p/article/details/7452846 ‘Clean’ Your Eclipse Project: Go to P

The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly reference 問題之解決

問題原因: 專案中缺少jar包:servlet-api.jar 解決辦法: 方法1:把 servlet-api.jar 新增到專案中(該jar包在Tomcat目錄的lib資料夾下) 方法2:專案中新增

java 錯誤:The type java.util.Comparator cannot be resolved. It is indirectly referenced from required

The type java.util.Comparator cannot be resolved. It is indirectly referenced from required .class files 1、錯誤描述: 源專案編譯環境為jdk1.7 後來換成了jd

[Error!]the type java.lang.object cannot be resolved. it is indirectly reference

MyEclipse 匯入專案時出現如下錯誤,檢查過,包的匯入都正常Error!]the type java.lang.object cannot be resolved. it is indirectly referenced from required .class files找了半天,才發現,原來是jdk

The type org.springframework...DaoSupport cannot be resolved. It is indirectly..

在整合[hibernate]和[spring]的時候出現以下異常:The hierarchy of the type xxx is inconsistentThe type org.springframework.dao.support.DaoSupport cannot be resolved. It i

ubuntu下IDEA配置tomcat錯Warning the selected directory is not a valid tomcat home

warn 技術 span 更改 文件目錄 tor 選擇 spa .com 產生這個問題的主要原因是文件夾權限問題。 可以修改文件夾權限或者更改tomcat文件目錄所有者。 這裏我直接變更tomcat文件夾所有者: sudo chown -R skh:skh tomcat-

js錯 Uncaught TypeError: xxxx.each is not a function

each err typeerror span xxx list 報錯 pan 使用 在處理ajax返回的json數組時錯誤的使用了 list.each(function(){ }); 實際上當遍歷json數組是應該使用