NoClassDefFoundError的在IDE的IntelliJ Android应用 [英] NoClassDefFoundError in an Android app in IntelliJ IDE

查看:139
本文介绍了NoClassDefFoundError的在IDE的IntelliJ Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了正在使用的意图,打开活动时产生的NoClassDefFoundError异常活动的子类的整体裹。该应用程序编译罚款没有任何错误,但在执行我看到这些的NoClassDefFoundError例外。我的理解是,编译器工作正常,但链接和APK建设过程中不包括所有的类,因此构建工作确定,但执行失败。

I am seeing a whole swathe of activity subclasses that are resulting in NoClassDefFoundError exceptions when using an intent to open the activity. The app compiles fine without any errors, but on executing I am seeing these NoClassDefFoundError exceptions. My understanding is that the compiler is working fine, but the linking and APK-building process is not including all the classes, hence the build working ok but the execution failing.

这是工作类和不相同的源文件夹坐,所以我不能立即看到他们为什么失败的人。所有正确的清单中引用。

The classes that work and the ones that don't sit in the same source folder, so I cannot immediately see why they are failing. All are correctly referenced in the manifest.

我是什么失踪?

code:

startActivity(new Intent(Dashboard.this, SearchResultFavourites.class));

清单:

<activity android:name=".activity.SearchResultFavourites" android:launchMode="singleTask" />

例外:

Caused by: java.lang.NoClassDefFoundError: myapp.activity.SearchResultFavourites at
myapp.activity.Dashboard.dashBoardBtnClick(Dashboard.java:72)

我是pretty肯定这是一个的IntelliJ项目配置问题。

I'm pretty sure this is an IntelliJ project config issue.

推荐答案

该解决方案是相当切线。我是建设与GMaps实现API的.jar的应用程序,但未能将其设置为外部库。重建与GMaps实现API项目的.jar正确设置为外部库解决了问题。

The solution was rather tangential. I was building the app with the GMaps API .jar but had failed to set it as an external library. Rebuilding the project with the GMaps API .jar correctly set up as an external library resolved the issue.

我不知道一个图书馆,为什么是在APK或者不应该导致完全无关类,例外,但我们走了。

I have no idea why whether a library is in the APK or not should cause that exception with completely unrelated classes, but there we go.

这篇关于NoClassDefFoundError的在IDE的IntelliJ Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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