看板 AndroidDev 關於我們 聯絡資訊
開發層: (應用/框架/庫/核心) 應用 問題: 最近剛開始接觸Android 在試著寫藍芽的範例程式 (android developer上的bluetooth chat) 因為是第一次接觸 所以就一個字不改的複製貼上 不過目前遇到的錯誤是 有些變數會顯示錯誤cannot be resolved or isnot a field ex:R.string.title_connecting 可是我去檢查values目錄底下的strings.xml 我裡面的確有寫 <string name=title_connecting">....</string> 還有一些其他的變數也是類似的問題 R.id.xxxxx ~~ 之前在寫一些範例也常會遇到照著打會有同樣類型的錯 可是把書上的範例檔import進來就ok 想請問類似這種問題該怎麼去處理呢? 謝謝 輸入: 預期輸出: 錯誤輸出: 錯誤訊息: cannot be resolved or isnot a field 程式碼: (請多利用置底文網站) 參考: (書籍/網頁/...) http://developer.android.com/resources/samples/BluetoothChat/index.html 補充說明: -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.96.194.9
jimwayne123:<string name=title_connecting"> => 雙引號問題?? 06/01 12:46
lunared:厄....不是,我少貼了前" 06/01 17:34
coronach:上面選單選Project=>Clean試試看? 06/02 00:05
ericinttu:R.xx.xx 的compiler錯誤,請去看R檔裡面有沒有產生該名稱 06/02 08:19
ericinttu:. 沒有該名稱的話,有兩個原因:1.project還沒build. 06/02 08:20
ericinttu:2. project 存在錯誤 (不一定是在.java,可能是 string檔 06/02 08:20
ericinttu:manifest檔,或者檔名問題等等 06/02 08:21