標籤:
單獨用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錯誤