【发布时间】:2012-04-11 11:44:46
【问题描述】:
我已使用 Eclipse 通过在其 android 属性中将“Is Library”设置为 true,将现有的 android 项目(例如 App1)转换为 android 库项目。 然后在我的另一个项目(比如 App2)中,我通过在其库引用中添加 App1 使用 eclipse 添加了这个库项目。 在 App2 中,我尝试启动 App1 的活动。 我在 App2 的清单文件中提到了这个活动。
Intent intent = new Intent(TestActivity.this, ForYouActivity.class);
TestActivity.this.startActivityForResult(intent, 1);
但是当我运行应用程序时,我得到一个错误
E/AndroidRuntime(2489): java.lang.NoClassDefFoundError: com.test.activities.ForYouActivity
请帮我解决这个问题。 提前致谢
【问题讨论】:
-
感谢您回复@Frankenstein。我正在使用 ADT 16。我尝试在我的项目中添加一个名为“libs”的文件夹,并将我的库项目 jar 放入其中,......但我得到了同样的错误。
标签: android eclipse noclassdeffounderror android-library