使用 Mark Murphy 的 MergeAdapter 时,一切编译正常,但是当 ListView 绑定发生时,调用 addAdapter() 方法时出现以下错误:
java.lang.NoClassDefFoundError: com.commonsware.cwac.sacklist.SackOfViewsAdapter
SackOfViewsAdapter jar 文件确实存在于 cwac-merge 项目的 libs 目录中。
我已经检查了该项目附带的演示项目,但我看不到任何我没有的东西,尽管当我尝试运行它时出现 NoClassDefFoundError 异常。
我感觉这是一个 Eclipse 配置问题,但我已经尝试了所有我能想到的方法。
有任何想法吗?
** 更新:SackOfViewsAdapter 也显示为 cwac-merge 项目中的引用库。
** 更新 2:我的 .classpath:
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="lib" path="/Users/colsen/Projects/android/cwac-merge/libs/CWAC-SackOfViewsAdapter.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
** 更新 3 - 将 SackOfViewsAdapter 复制到本地库目录。
<classpath>
<classpathentry kind="lib" path="libs/CWAC-SackOfViewsAdapter.jar"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>