2015-02-07 65 views
0

我對Android開發非常陌生。我只是設置了環境並使用Android Studio。 如上所述;將ZXing項目導入到Ubuntu上的Android Studio中

Integrate ZXing in Android Studio

我已經進口了斑馬線-2.3.0項目到Android Studio中,並加入核心3.1.0.jar作爲庫的項目,但是當試圖建立的項目,我仍然得到下面的錯誤消息。可能是什麼問題呢?

> Information:Using javac 1.7.0_65 to compile java sources 
> Information:java: Errors occurred while compiling module 'main5' 
> Information:Compilation completed with 53 errors and 0 warnings in 15 
> sec Information:53 errors Information:0 warnings 
> /home/korhan/Android/libraries/zxing-2.3.0/android-integration/src/main/java/com/google/zxing/integration/android/IntentIntegrator.java 
> Error:(26, 19) java: package android.app does not exist Error:(27, 19) 
> java: package android.app does not exist Error:(28, 23) java: package 
> android.content does not exist Error:(29, 23) java: package 
> android.content does not exist Error:(30, 23) java: package 
> android.content does not exist Error:(31, 26) java: package 
> android.content.pm does not exist Error:(32, 26) java: package 
> android.content.pm does not exist Error:(33, 19) java: package 
> android.net does not exist Error:(34, 18) java: package android.os 
> does not exist Error:(35, 20) java: package android.util does not 
> exist Error:(141, 17) java: cannot find symbol symbol: class 
> Activity location: class 
> com.google.zxing.integration.android.IntentIntegrator Error:(149, 27) 
> java: cannot find symbol symbol: class Activity location: class 
> com.google.zxing.integration.android.IntentIntegrator Error:(233, 16) 
> java: cannot find symbol symbol: class AlertDialog location: 
> class com.google.zxing.integration.android.IntentIntegrator 
> Error:(245, 16) java: cannot find symbol symbol: class AlertDialog 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(283, 41) java: cannot find symbol symbol: class Intent 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(287, 39) java: cannot find symbol symbol: class Intent 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(300, 44) java: cannot find symbol symbol: class ResolveInfo 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(310, 11) java: cannot find symbol symbol: class AlertDialog 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(351, 83) java: cannot find symbol symbol: class Intent 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(376, 16) java: cannot find symbol symbol: class AlertDialog 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(389, 16) java: cannot find symbol symbol: class AlertDialog 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(411, 33) java: cannot find symbol symbol: class Intent 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(246, 5) java: cannot find symbol symbol: class Intent 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(246, 29) java: cannot find symbol symbol: class Intent 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(247, 28) java: cannot find symbol symbol: variable Intent 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(267, 25) java: cannot find symbol symbol: variable Intent 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(268, 25) java: cannot find symbol symbol: variable Intent 
> location: class com.google.zxing.integration.android.IntentIntegrator 
> Error:(288, 5) java: cannot find symbol symbol: class 
> PackageManager location: class 
> com.google.zxing.integration.android.IntentIntegrator Error:(289, 10) 
> java: cannot find symbol symbol: class ResolveInfo location: 
> class com.google.zxing.integration.android.IntentIntegrator 
> Error:(289, 72) java: cannot find symbol symbol: variable 
> PackageManager location: class 
> com.google.zxing.integration.android.IntentIntegrator Error:(301, 10) 
> java: cannot find symbol symbol: class ResolveInfo location: 
> class com.google.zxing.integration.android.IntentIntegrator 
> Error:(311, 16) java: package AlertDialog does not exist Error:(311, 
> 57) java: package AlertDialog does not exist Error:(314, 68) java: 
> package DialogInterface does not exist Error:(335, 67) java: package 
> DialogInterface does not exist Error:(353, 25) java: cannot find 
> symbol symbol: variable Activity location: class 
> com.google.zxing.integration.android.IntentIntegrator Error:(390, 5) 
> java: cannot find symbol symbol: class Intent location: class 
> com.google.zxing.integration.android.IntentIntegrator Error:(390, 25) 
> java: cannot find symbol symbol: class Intent location: class 
> com.google.zxing.integration.android.IntentIntegrator Error:(391, 24) 
> java: cannot find symbol symbol: variable Intent location: class 
> com.google.zxing.integration.android.IntentIntegrator Error:(400, 21) 
> java: cannot find symbol symbol: variable Intent location: class 
> com.google.zxing.integration.android.IntentIntegrator Error:(401, 21) 
> java: cannot find symbol symbol: variable Intent location: class 
> com.google.zxing.integration.android.IntentIntegrator Error:(426, 35) 
> java: cannot find symbol symbol: class Bundle location: class 
> com.google.zxing.integration.android.IntentIntegrator Error:(427, 31) 
> java: cannot find symbol symbol: class Bundle location: class 
> com.google.zxing.integration.android.IntentIntegrator 
> /home/korhan/Android/libraries/zxing-2.3.0/android-integration/src/main/java/com/google/zxing/integration/android/IntentIntegratorV30.java 
> Error:(19, 19) java: package android.app does not exist Error:(20, 23) 
> java: package android.content does not exist Error:(29, 17) java: 
> cannot find symbol symbol: class Fragment location: class 
> com.google.zxing.integration.android.IntentIntegratorV30 Error:(34, 
> 30) java: cannot find symbol symbol: class Fragment location: 
> class com.google.zxing.integration.android.IntentIntegratorV30 
> Error:(40, 41) java: cannot find symbol symbol: class Intent 
> location: class 
> com.google.zxing.integration.android.IntentIntegratorV30 
> /home/korhan/Android/libraries/zxing-2.3.0/android-integration/src/main/java/com/google/zxing/integration/android/IntentIntegratorSupportV4.java 
> Error:(18, 23) java: package android.content does not exist Error:(19, 
> 30) java: package android.support.v4.app does not exist Error:(28, 17) 
> java: cannot find symbol symbol: class Fragment location: class 
> com.google.zxing.integration.android.IntentIntegratorSupportV4 
> Error:(33, 36) java: cannot find symbol symbol: class Fragment 
> location: class 
> com.google.zxing.integration.android.IntentIntegratorSupportV4 
> Error:(39, 41) java: cannot find symbol symbol: class Intent 
> location: class 
> com.google.zxing.integration.android.IntentIntegratorSupportV4 

回答

1

這些都是非常古老的說明。項目文檔可能會有更多幫助。 https://github.com/zxing/zxing/wiki/Getting-Started-Developing您應該使用最近的版本,而不是2.3。

我不清楚你想要做什麼。在這裏,你已經下載了源代碼,並試圖直接打開它作爲一個項目。這個錯誤意味着它說:你沒有設置你的項目來依賴庫中的任何庫,比如Android。相反,你應該已經導入了Maven構建。

但是你說你正在添加核心.jar文件,但是來自完全不同的版本3.1.0。到底是怎麼回事?

+0

我想要做的是將ZXing庫導入到Android Studio中,然後將其與我的項目進行整合,以實現一個簡單的QRCoreScanner。我如何設置這個項目與圖書館的需求? – kyy 2015-02-07 19:37:50

+0

然後你不需要下載或建立任何東西。你只需要核心lib或android-integration庫。開始你自己的項目。 – 2015-02-07 20:31:52

+0

好的,我會嘗試 – kyy 2015-02-08 10:29:04

相關問題