PhoneGap的酒吧codeScanner - ClassNotFound的酒吧、PhoneGap、ClassNotFound、codeScanner

2023-09-08 00:20:53 作者:空扰寡人

更新2

我张贴能解决我原来的问题的答案。请参见,对于更多的信息。

I posted an answer that fixes my original problem. See that for more information.

更新FYI任何人想知道,到底我发现这个: http://github.com/commonsguy/zxingdemo /树/主正是我需要得到它的滚动是一个简单的演示了工作!此外,由于肖恩指着我在Google上搜寻我的方向是正确的。

UPDATE FYI for anyone wondering, in the end I found this: http://github.com/commonsguy/zxingdemo/tree/master Exactly what I needed to get it rolling was a simple demo that worked! Also, thanks to Sean for pointing me in the right direction for my googling.

目前我正在试图建立一个简单的Andr​​oid应用程序,可以在酒吧code扫描。我已经通过多个教程看,想尽一切办法一个T,并重新尝试并重新尝试。毫无效果。所以现在我要问援助看到我错在哪里。

I am currently trying to build a simple android app that can scan in a barcode. I have looked through multiple tutorials, tried everything to a T, and re-tried and re-tried. Nothing worked. So now I am going to ask for assistance to see where I went wrong.

要列出我也跟着教程:

https://github.com/phonegap/ PhoneGap的-插件/树/主/ Android版/酒吧codeScanner 第一次尝试这一个。 http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt3 的http://simonmacdonald.blogspot.com/2011/12/installing-bar$c$c-plugin-for-phonegap.html https://github.com/phonegap/phonegap-plugins/tree/master/Android/BarcodeScanner Tried this one first. http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt3 http://simonmacdonald.blogspot.com/2011/12/installing-barcode-plugin-for-phonegap.html

加几个其他人,但更多或更少的击中点到同样的处理。一些关键点,当我添加了 LibraryProject 我的项目作为一个库,应用程序将无法编译,直到我创建一个的Andr​​oidManifest.xml 我试着用在LibraryProject发现之一,并尝试创建一个光秃秃的mininmal之一,这将允许编译,但应用程序ForceCloses。

Plus a couple others, but more or less hit the point to the same process. Some key points, when I add the LibraryProject to my project as a Library, the app will not compile until I create an AndroidManifest.xml I tried using the one found in the LibraryProject and tried creating a bare mininmal one, both would allow to compile, but the app ForceCloses.

当我加载该应用并点击扫描,它ForceCloses和LogCat中的Eclipse中的调试日志我得到:

When I load up the App and click "Scan" it ForceCloses and in the debug log of LogCat in Eclipse I get:

java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.myapp/com.google.zxing.client.android.CaptureActivity}: java.lang.ClassNotFoundException:
com.google.com.zxing.client.android.CaptureActivity in loader dalvik.system.PathClassLoader[/data/app/com.myapp-1.apk]

我曾尝试谷歌上搜索,发现了一些问题,但没有真正明确的或固体的答案,最公正的点上面的教程。我不知道如果教程只是过时或我愚蠢和我失去了一些东西的关键。这方面的工作了几天,现在和我在我束手无策。

I have tried googling, found a few issues, but no real clear or solid answers, most just point to the tutorials above. I am not sure if the tutorials are just outdated or I am being stupid and am missing something key. Been working on this for a few days now and am at my wits end.

如果你能帮助我将AP preciate它。为了避免对答案,如果我做了X或X,这里是我做了什么。

If you can help I would appreciate it. To avoid answers regarding if I have done X or X, here is what I have done.

当我测试应用程序,我简要地看它试图加载酒吧codeScanner,但之后我看到它ForceCloses。我不知道我错过了什么,但对于引用我将张贴code我目前已经安装测试:

When I test the application, I do briefly see it trying to load BarcodeScanner, but right after I see that it ForceCloses. I am not sure what I am missing, but for references I will post the code I currently have setup to test:

AndroidManifest.xml中 - http://pastebin.com/qq9q0ZU7

AndroidManifest.xml - http://pastebin.com/qq9q0ZU7

Plugins.xml - http://pastebin.com/dZ5eKPSU

Plugins.xml - http://pastebin.com/dZ5eKPSU

index.html的 - http://pastebin.com/wvht4ken

index.html - http://pastebin.com/wvht4ken

如果我需要张贴任何其他项目让我知道。

If I need to post any other items let me know.

推荐答案

好了,所以有这个问题的人,你有两个选择。您可以使用ScanningViaIntent,肖恩指出。它的伟大工程,如果你需要看的例子在CommonsGuy。至于教程我张贴以上得到这个工作与PhoneGap的,我的整个问题是,当我进口 LibraryProject 我没有回去过,并添加文件。我不知道如果我在Eclipse中的设置是坏的。但我基本上只是右点击了LibraryProject,去导入 - >文件结构 - >图书馆项目的原始项目的路径,并加载所有的回在那里。

Ok, so for anyone having this problem, you have two choices. You can use the ScanningViaIntent, as Sean pointed out. It works great, if you need an example look at CommonsGuy. As for the tutorials I posted above to get this working with PhoneGap, my whole problem was, after I imported the LibraryProject I did not go back through and add the files. I am not sure if a setting in my Eclipse is bad. But I basically just right clicked on the LibraryProject, went to Import -> File Structure -> Library Project's original project path, and loaded all of it back in there.

有可能是错误的东西与我的Eclipse设置,但高雅。我现在有酒吧codeScanner插件PhoneGap的工作!

There is probably something wrong with my Eclipse setup, but yea. I now have the BarcodeScanner plugin for PhoneGap working!