2013-07-25 61 views
2

我已經得到一個已經在開發中的項目來繼續。在將其導入到Android Studio並使用libs和項目進行所有配置後,我編譯它並在設備上運行它,但是我一直都會一遍遍地得到NoClassDefFoundError。Android工作室和NoClassDefFoundError

我一直在做最後兩天在網絡上發現的修復和密切關注庫。

目前,我有這樣的:

這是主要的Android項目: enter image description here

這是LIB項目(斑馬線,Android系統的最低要求)之一: enter image description here

只要我建立並部署到設備,我得到這個奇妙的錯誤:

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類在zxing項目中。該項目僅包含在主項目中。

正如我在開始時提到的,我已經嘗試了不同的配置,並在本質的其他問題上提出了lib導入,但都沒有工作。因此,我失去了另一天的工作絕望,我已經發布了這個問題。

感謝您對這個噩夢的任何幫助。

回答

2

我發現發生了什麼事。 問題是,當我導入項目時,除了zxing項目之外,每個項目都被標記爲一個庫。當部署它創建的應用程序與這些項目,我的主應用程序無法訪問它。

我不得不去看看方面,並檢查xzing項目的庫模塊(對於某些reasion,android studio並不像其他項目那樣將其識別爲導入的庫文件)