SystemProperties cannot be resolved錯誤

 

單獨用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的包前面即可


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章