Eclipse导入layoutlib.jar编译出现DEX error的解决方案

在做第一个Android APK的时候需要连接layoutlib.jar。结果出现了一个错误:

 

Dex Loader] Unable to execute dex: null
Conversion to Dalvik format failed: Unable to execute dex: null
并且经常出现out of memory error的错误An internal error occurred during: "Build Project".
Java heap space

 

也就是DEX Error 错误。

第一次碰见,真的是头都大了。后来baidu+Google.果然不负有心人。

 

 

应该采用用户库的形式导入该库,具体步骤如下:

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。

Thank God.

 

经验:碰见莫名其妙的问题,先网上查查,莫着急。

 

阅读更多
个人分类: Android
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭