Android的工作室,并出现NoClassDefFoundError [英] Android studio and NoClassDefFoundError

查看:293
本文介绍了Android的工作室,并出现NoClassDefFoundError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在考虑一个项目,已经在发展中继续。它库和项目​​导入到Android Studio和做所有的配置后,我编译它,并在设备上运行它,但我得到的所有时间NoClassDefFoundError的一遍又一遍。

I've been given a project that was already in development to continue. After importing it to Android Studio and doing all the configurations with libs and projects I compile it and run it on a device but i get all the time NoClassDefFoundError over and over.

我已经在过去两天做在网络上找到修复和密切关注的库。

I've been for the last two days doing fixes found on the web and paying close attention to the libs.

目前,我有这样的:

这是主要的Andr​​oid项目:

this is the main android project:

这是的lib项目(zxing-Android的最低要求)之一:

this is one of the lib projects (zxing-android-minimal):

当我建立并将其部署到设备我得到这个梦幻般的埃罗:

As soon as I build and deploy it to the device i get this fantastic erro:

E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: com.google.zxing.client.android.camera.CameraConfigurationManager
    at pt.novabase.ocr.poc.camera.PhotoModule.onResumeAfterSuper(PhotoModule.java:152)
    at pt.novabase.ocr.poc.CameraActivity.onResume(CameraActivity.java:109)
    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
    at android.app.Activity.performResume(Activity.java:3832)
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2231)
    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2256)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1789)
    at android.app.ActivityThread.access$1500(ActivityThread.java:123)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3835)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
    at dalvik.system.NativeStart.main(Native Method)

com.google.zxing.client.android.camera.CameraConfigurationManager 类是在斑马线项目。该项目仅包含在主项目。

The com.google.zxing.client.android.camera.CameraConfigurationManager class is in the zxing project. This project is only included in the main project.

正如我在一开始提到的我已经试过的lib进口不同的配置建议在此性质的问题,但没有奏效。所以,失去了在这一天的工作绝望的我已经张贴了这个问题。

As I mentioned in at the start i've tried different configuration with the lib imports suggested on other question of this nature but none worked. So out of despair of losing another day's work on this I've posted this question.

感谢您对这个噩梦的任何帮助。

Thanks for any help on this nightmare.

推荐答案

我发现发生了什么事。
问题是,当我进口的项目中的每个项目被标注为除了为斑马线项目库。当部署它创造了这些项目的应用和我的主要应用程序没有访问它。

I've found what was happening. the problem was that when i imported the project every project was noted as a library except for the for the zxing project. When deploying it created applications with those project and my main app didn't have access to it.

我只好去了面,并检查是针对xzing项目库模块(某些reasion Android的工作室并没有认识到它作为一个lib进口,如项目的其余部分。

I had to go to the facets and check the is library module for the xzing project (for some reasion the android studio didn't recognize it as a lib on import like the rest of the projects.

这篇关于Android的工作室,并出现NoClassDefFoundError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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