Android的库项目滑动菜单抛出java.lang.NoClassDefFoundError:com.slidingmenu.lib.R $设置样式 [英] Android library project Sliding Menu throws java.lang.NoClassDefFoundError: com.slidingmenu.lib.R$styleable

查看:180
本文介绍了Android的库项目滑动菜单抛出java.lang.NoClassDefFoundError:com.slidingmenu.lib.R $设置样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序,我试图用一个库滑动菜单(github.com/jfeinstein10/SlidingMenu)。不过,我在一个干净的项目中使用该库的问题。我得到

I'm developing an android application and I'm trying to use a library Sliding Menu (github.com/jfeinstein10/SlidingMenu). However, I have a problem in using the library in a clean project. I get

java.lang.NoClassDefFoundError: com.slidingmenu.lib.R$styleable

在做的时候

SlidingMenu slidingMenu = new SlidingMenu();

配置测试:
JDK测试1.6u43,1.7(最新)
项目目标API =试图同时在Android 4.2.2和谷歌API 17
SDK版本测试21,21.0.1,21.1
Windows 8的专业版x64,Intel酷睿i7 3610QM,英伟达GT660M,三星840 Pro的SSD 256GB
都与Actionbarsherlock没有它集成。

Configurations tested: JDK tested 1.6u43, 1.7(latest) Project target api = tried both Android 4.2.2 and Google API 17 SDK versions tested 21, 21.0.1, 21.1 Windows 8 Pro x64, Intel Core i7 3610QM, Nvidia GT660M, Samsung Pro 840 256GB SSD Integrated both with Actionbarsherlock and without it.

我输入库中,从现有的code创建Android项目,标志着在android性能是库,然后在原来的应用程序的Andr​​oid特性referrencing它(不通过的.jar)

I import the library, by creating an Android Project from Existing Code, marking "Is Library" in the android properties, and then referrencing it in the original application android properties (not via .jar)

下面链接,code段,全堆栈跟踪和当前配置的屏幕截图

Below links to code snippets, full stacktrace and screenshots of current configurations

code片断:
http://pastebin.com/2yzRC5AJ

完整堆栈跟踪:
http://pastebin.com/D7RQwuQd

我一直停留在这3天,现在...:/

I've been stuck on this for 3 days now... :/

推荐答案

我不得不添加两种方式之前,我消灭我noclassdef错误的依赖

I had to add the dependency two ways before I eradicated my noclassdef errors


  1. 在library.jar从添加/ bin中的依赖关系到您的构建路径,请确保选择排序和导出选项卡,并选中该复选框,以及对新的依赖。

  1. Add the library.jar from /bin as dependency to your build path, make sure to select the Order and Export tab and select the check box as well for the new dependency.

添加通过鼠标右键点击该库在你的项目,然后属性,然后Android的再加入库

Add the library via right mouse click on your project, then properties, then android then add library

Voilla

我这个挣扎的欢迎,并从大量的谷歌搜索,好不容易才拼凑了一起。

I struggled with this as well, and from a vast number of google searches, managed to piece this together.

希望它可以帮助..

这篇关于Android的库项目滑动菜单抛出java.lang.NoClassDefFoundError:com.slidingmenu.lib.R $设置样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆