Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲

Resource is out of sync with the file system 的解決方法

編輯:關於 Android 程式設計

在 Eclipse 或 MyEclipse 中,執行 Run on Server 或檢視專案檔案時,可能會遇到類似以下的錯誤:

Resource is out of sync with the file system:
'/Test_1_Struts_Spring_Hibernate/WebContent/WEB-INF/.struts-config.xml.strutside'.

這是典型的檔案系統不同步問題,通常是由於在 Eclipse 或 MyEclipse 之外修改了專案中的資源所引起(例如用其他工具、或在不同系統之間編輯檔案)。不過有時即使沒有在 IDE 外部動過檔案,也可能出現類似錯誤。

解決辦法

核心做法是手動重新整理資源管理器:

  1. 在 Eclipse 或 MyEclipse 中,對專案目錄按右鍵,選擇 F5(Refresh) 手動刷新。
  2. 設定 IDE 自動刷新:透過 Window → Preferences → General → Workspace,勾選 Refresh automatically。

完成上述設定後,IDE 便會在偵測到外部檔案變更時自動同步,能有效避免這類不同步錯誤再次發生。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © Android教程網 All Rights Reserved