When using Mark Murphy’s MergeAdapter everything compiles fine, but when the ListView binding occurs I get a crash with the following error when calling the addAdapter() method:
java.lang.NoClassDefFoundError: com.commonsware.cwac.sacklist.SackOfViewsAdapter
The SackOfViewsAdapter jar file does exist within libs dir of the cwac-merge project.
I have checked out the demo project that comes with the project and I can’t see anything that it has that I don’t, although I get NoClassDefFoundError exceptions when I try to run it.
I have a feeling this is an Eclipse configuration issue, but I have tried everything that I can think of.
Any ideas?
** Update: the SackOfViewsAdapter also shows up as a referenced library in the cwac-merge project.
** Update 2: My .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>
** Update 3 – copied SackOfViewsAdapter to local libs dir.
<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>
It looks like you need to also add
SackOfViewsAdapter.jarto your Eclipse build path of the project usingMergeAdapter. Even though the library project’s reference to this works at compile time, it will not work at runtime.I just updated the
demo/Eclipse project files to reflect this.My apologies for the difficulty.