MergeAdapter 出现问题

发布于 2025-01-05 11:36:49 字数 1567 浏览 0 评论 0原文

当使用 Mark Murphy 的 MergeAdapter 时,一切都可以正常编译,但是当 ListView 绑定发生时,在调用 addAdapter() 方法时出现以下错误,导致崩溃:

java.lang.NoClassDefFoundError: com.commonsware.cwac.sacklist.SackOfViewsAdapter< /code>

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 复制到本地 libs 目录。

<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>

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

姐不稀罕 2025-01-12 11:36:49

SackOfViewsAdapter jar 文件确实存在于 cwac-merge 项目的 libs 目录中。

看起来您还需要使用 MergeAdapterSackOfViewsAdapter.jar 添加到项目的 Eclipse 构建路径中。尽管库项目对此的引用在编译时有效,但在运行时不起作用。

我刚刚更新了 demo/ Eclipse 项目文件来反映这一点。

对于造成的困难,我深表歉意。

The SackOfViewsAdapter jar file does exist within libs dir of the cwac-merge project.

It looks like you need to also add SackOfViewsAdapter.jar to your Eclipse build path of the project using MergeAdapter. 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文