SystemProperties cannot be resolved錯誤

來源:互聯網
上載者:User

標籤:

單獨用eclipse開啟一個工程,出現SystemProperties.get()會出現SystemProperties cannot be resolved.錯誤

1. 引用SystemProperties.get()會出現SystemProperties cannot be resolved.

解決方案: 

在當前工程屬性(Properties) -> Java Build Path -> Libraries 

點擊Add External JARs...按鈕, 選擇layoutlib.jar檔案,然後在項目源檔案中增加import android.os.SystemProperties;

layoutlib.jar檔案位於: android sdk/platforms/android-*.*/data目錄下.

 

layoutlib.jar項目是從外部匯入Eclipse中的,只要一編譯,就會報錯:Conversion to Dalvik format failed: Unable to execute dex: null , 同時Eclipse也變的很卡,好幾次都掛掉了.

解決

1:設定記憶體

eclipse.exe的捷徑——右鍵/屬性 在 目標 裡填寫如下內容
"D:/eclipse/eclipse.exe" -vmargs -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M

雙引號內 為eclipse的安裝路徑。

如果1不行:

應該採用使用者庫的形式匯入該庫,具體步驟如下:

1. Right-click the project in Eclipse and select "Build Path -> Add Libraries...".
2. Select User Library from the list and click Next.
3. Click the "User Libraries..." button.
4. Click "New..." in the User Libraries dialog.
5. Give the user library a name and select the System library checkbox and click OK.
6. Highlight the newly added user library in the list and click the "Add JARs..." button and add the desired jar files.
7. Click OK on the User Libraries dialog.
8. Make sure the new user library is checked in the Add Library dialog and 

用到我自己的項目上去。編譯OK。

如果還是有紅色叉叉,則選擇java build path  --》order and export把自己匯入的包放到android的包前面即可

SystemProperties cannot be resolved錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.