Can't import zxing in eclipse

986 views
Skip to first unread message

Mehdi Masrour

unread,
Dec 23, 2010, 1:01:24 PM12/23/10
to zxing
Hello everyone !

I am posting this message because I would like to develop an
application using zxing but I can't import it in Eclipse.

I will write every step I do to import it, maybe there is something
I'm not doing or I'm doing wrong so ...

( of couse, android sdk is installed, eclipse is ok and so on )

on eclipse : File -> New Project -> New Android Project

then, create project from existing source, screenshot :
http://i55.tinypic.com/5obk0x.png

then I click on Finish, but when the project is created, screenshot :
http://i51.tinypic.com/x2ny4o.png

As you can see, there are errors everywhere, so I can't work with
zxing :(

I hope someone will help me lol !

Thanks in advance !!

alex_p

unread,
Dec 23, 2010, 7:28:05 PM12/23/10
to zxing
i had the same problem, but after i built the "android" project from
zxing it generated me the folowing in "gen" folder: /com/google/zxing/
client/android/R.java. copying it into the gen folder of the project
removed all the errors. you have to build it with ant. maybe this
thread helps you too: http://groups.google.com/group/zxing/browse_thread/thread/3ba10aed05402b42

Vaibhav Tyagi

unread,
Dec 24, 2010, 9:01:31 AM12/24/10
to zxing
Hii Alex,

I am new to android.I have just created a "Hello World" application in
android.
I want to make project with zxing but don't know how to setup things
to work.

Could you please tell me how to setup all things.
I am working on Windows Seven.

Please Help me.I really need your assistance.

Regards
Vaibhav
> thread helps you too:http://groups.google.com/group/zxing/browse_thread/thread/3ba10aed054...

alex_p

unread,
Dec 24, 2010, 3:10:27 PM12/24/10
to zxing
you first need to build "core" with ant. just google for a windows
installation of ant if you dont have it. create a lib folder in your
project and put the generated core.jar there. then build "android"
with ant. if you have problems (like i did) check out this thread:
http://groups.google.com/group/zxing/browse_thread/thread/3ba10aed05402b42
put the folder from "gen" in android in your project's "gen" folder. i
don't know if it's nessesary (could someone tell if it is?) but you
then can put all the files from src in you project's src folder. from
there on i can't help you because i just have started and didn't do
much more myself. try this links for more info:
http://code.google.com/p/zxing/wiki/GettingStarted
http://code.google.com/p/zxing/wiki/DeveloperNotes

alex_p

unread,
Dec 25, 2010, 5:15:24 PM12/25/10
to zxing
i forgot to mention that you have to refresh your project in eclipse,
rightclick on core.jar and then add it to build path

Vaibhav Tyagi

unread,
Dec 26, 2010, 2:37:26 AM12/26/10
to zxing
Hi Alex Thanks for reply.

Mehdi Masrour

unread,
Dec 27, 2010, 6:13:20 AM12/27/10
to zxing
hi alex

thanks for the answer but I still have problems ...
I succesfully built core with ant, I copied core.jar in android/lib
Then I try to build android with and but I have the following error :

mehdi@Laptop:~/zxing-read-only/android$ ant
Buildfile: /home/mehdi/zxing-read-only/android/build.xml

BUILD FAILED
/home/mehdi/zxing-read-only/android/build.xml:64: taskdef class
com.android.ant.SetupTask cannot be found
using the classloader AntClassLoader[]

Thanks in advance for your help ...


On 24 déc, 21:10, alex_p <alex.philip...@googlemail.com> wrote:
> you first need to build "core" with ant. just google for a windows
> installation of ant if you dont have it. create a lib folder in your
> project and put the generated core.jar there. then build "android"
> with ant. if you have problems (like i did) check out this thread:http://groups.google.com/group/zxing/browse_thread/thread/3ba10aed054...

Mehdi Masrour

unread,
Dec 28, 2010, 10:32:11 AM12/28/10
to zxing
can someone help ?

Thanks
> > much more myself. try this links for more info:http://code.google.com/p/zxing/wiki/GettingStartedhttp://code.google....

Mehdi Masrour

unread,
Dec 30, 2010, 4:27:28 AM12/30/10
to zxing
Hi everyone, I'm still looking for help

Thanks in advance to whoever will be able to help me !

On 27 déc, 12:13, Mehdi Masrour <mehdi.masr...@gmail.com> wrote:
> > much more myself. try this links for more info:http://code.google.com/p/zxing/wiki/GettingStartedhttp://code.google....

Michael Olenick

unread,
Dec 30, 2010, 5:00:20 PM12/30/10
to zxing
I've been working on this for awhile now.

Managed to build core; required two passes for some reason but built
on second pass. Then built the client. Then renamed both output jar
files and put in my projects lib directory. Then added to the Java
build path. Now Eclipse sees everything: will see if it works.

I don't know if it's against some unwritten or written rule or I'd
just upload the compiled jar's somewhere to skip all that for people
who want to use this in Eclipse as a component, rather than on a
camera or work on it. On one hand, building the jar is a little bit
of a hassle; on the other this looks like a massive project with an
enormous amount of functionality and maintaining compiled jar's would
just take developer time away .. plus there may be some other reason
I'm not thinking of.

So, if this didn't answer your question:
1. Unpack everything (unzip, untar, whatever's appropriate for your
platform...)
2. Make sure the jdk and ant are installed and working; you may need
tools.jar.
3. Build core, then build the client as per the instructions above
(just type "ant" without quotes) .. twice for core.
4. Take the two .jar files produced; it's probably good idea to rename
them to something you'll remember, and copy them into a lib folder,
then add them to search path
5. See if it all works (this last part off to check now).

Michael.
Reply all
Reply to author
Forward
0 new messages