简体   繁体   English

在eclipse中将库导入现有项目会造成很多麻烦

[英]Importing libraries to existing project in eclipse causing a lot of trouble

So I'm trying to import an existing project to eclipse and it's causing me a lot of trouble. 所以我试图将现有项目导入eclipse,这给我带来了很多麻烦。 I'll explain step by step, exactly how I'm trying to import it and someone please help me finish the importing because no matter how I do it, I still keep getting errors. 我将逐步解释,确切地说我是如何导入它的,有人请帮我完成导入,因为无论我怎么做,我仍然会遇到错误。

So as soon as I finish importing the existing android application there is a red exclamation mark (!) next to the project folder in eclipse. 因此,一旦我完成导入现有的Android应用程序,eclipse中项目文件夹旁边就会出现一个红色感叹号(!)。 So I right clicked it and selected 'configure build path' 所以我右键单击它并选择“配置构建路径” 在此输入图像描述

I then click on every single jar and select a new path. 然后我点击每个jar并选择一个新路径。 First, I found android support v4 in sdk/extras/android/support/v4, then I found google-play-services_lib in sdk/extras/google/google_play_services/libproject/google-play-services_lib/bin, and the last one (google-play-services) is at google-play-services_lib/bin. 首先,我在sdk / extras / android / support / v4中找到了android支持v4,然后我在sdk / extras / google / google_play_services / libproject / google-play-services_lib / bin中找到了google-play-services_lib,最后一个( google-play-services)位于google-play-services_lib / bin。

So now after I'm done setting paths for those jars, the red exclamation mark disappears and a new error appears. 所以现在在我为这些罐子设置路径之后,红色感叹号消失并出现新的错误。

在此输入图像描述

Now I right clicked the project again and selected properties --> android and this is what I see: 现在我再次右键单击该项目并选择属性 - > android,这就是我所看到的: 在此输入图像描述

I then imported google-play-services_lib in eclipse as 'library project', but the red cross remained there, so I tried adding it manually with 'add button'. 然后我在eclipse中将google-play-services_lib导入为“库项目”,但红叉仍然存在,所以我尝试用“添加按钮”手动添加它。

As for the other 2 missing libraries, I googled about it and found out that CaptureActivity is from zxing barcode scanned library. 至于其他2个缺少的库,我搜索了它,发现CaptureActivity来自zxing条形码扫描库。 So I downloaded the newest zxing version (2.2) and imported the library manually, same as I did with google play services. 所以我下载了最新的zxing版本(2.2)并手动导入了库,就像我使用google play服务一样。 Right after importing CaptureActivity in eclipse and before even adding it to my application, this is what happens and I have no idea how to fix it. 在eclipse中导入CaptureActivity之后,甚至在将其添加到我的应用程序之前,这就是发生的事情,我不知道如何解决它。 在此输入图像描述

Even though the eclipse gave me an error when importing zxing 2.2, I still added it to my project's libraries and now some errors disappeared. 即使在导入zxing 2.2时eclipse给我一个错误,我仍然将它添加到我的项目的库中,现在一些错误消失了。 The only error I'm still getting is on qr_portrait_camera in folder layout: 我仍然遇到的唯一错误是文件夹布局中的qr_portrait_camera: 在此输入图像描述

So I right clicked my imported project again to see build paths again and this is what I notice: 所以我再次右键单击我导入的项目再次查看构建路径,这是我注意到的: 在此输入图像描述

So this is it. 所以就是这样。 This is where I'm stuck and can't go forward, I googled a lot, did every kind of research I could and I don't know what to do anymore. 这是我被困住的地方,无法前进,我搜索了很多,做了各种研究,我不知道该怎么办。

These are the three remaining problems that I've got: 这是我得到的剩下的三个问题:

  • I need to import one more library and I don't know where to find it (PortraitQR): 我需要再导入一个库,我不知道在哪里找到它(PortraitQR):

在此输入图像描述

  • CaptureActiviy imported library project still shows a lot of red errors and I don't know how to fix that. CaptureActiviy导入的库项目仍然显示很多红色错误,我不知道如何解决这个问题。

  • There's a CaptureActivity.jar in build path that shows an error and I can't either remove it or find a path to it. 构建路径中有一个CaptureActivity.jar显示错误,我无法删除它或找到它的路径。

I really need to fix this as soon as possible, I will be very grateful for any kind of help! 我真的需要尽快解决这个问题,我将非常感谢任何帮助!

I figured it out. 我想到了。 I just had to put all jars in libs folder and then download all 3 libraries, The one missing was causing all the trouble. 我只需要把所有的jar放在libs文件夹中,然后下载所有3个库,丢失的那个导致了所有麻烦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM