ZXing import - missing core / build.xml

I am trying to import Google ZXing.

I downloaded the latest version from https://code.google.com/p/zxing/downloads/detail?name=ZXing-2.2.zip&can=2&q=

From the cmd prompt, I went to the root directory of the downloaded zxing and tried to execute

ant -f core \ build.xml

PROBLEM:

Buildfile: build.xml does not exist!

Build failed

My zxing-2.2 / core file contains:

Src

Test

pom.xml

Questions: How to create a file that is missing? Is this the problem with zxing-2.2.jar that I downloaded?

+7
ant core zxing
May 31 '13 at 12:27
source share
5 answers

This problem is with me too, I solved it by creating a build.xml file inside the main folder

change name = "whatever" in the second line, here it is "project"

build.xml code:

<?xml version="1.0" encoding="utf-8" ?> <project name="project" default="jar" basedir="."> <target name="compile" description="Compile source"> <mkdir dir="bin" /> <javac srcdir="src" includes="**" destdir="bin"/> <copy todir="bin"> <fileset dir="src" /> </copy> </target> <target name="jar" description="Package into JAR" depends="compile"> <jar destfile="project.jar" basedir="bin" compress="true" /> </target> </project> 

Run the build command again and see if it works.

+10
Jun 05 '13 at 2:10
source share

Please think that you can always use pom.xml to achieve the same. This is the method prescribed in the official zxing documentation https://code.google.com/p/zxing/wiki/GettingStarted The commands I used are the following: cd core mvn -DskipTests -Dgpg.skip=true install

To this, everything is ready. Obviously maven must be installed before using code

+3
Aug 31 '13 at 7:04 on
source share

I tried the accepted answer, but unfortunately it did not work. In fact, the jar was built successfully, but it was not built into apk when Eclipse built the project. That was when I called ZXing as a library project. I managed to write an ant script that works, so I share it here:

 <?xml version="1.0" encoding="utf-8" ?> <project name="core" basedir="." default="dist" > <property name="dist.dir" value="dist" /> <property name="src.dir" value="src" /> <property name="build.dir" value="bin" /> <target name="dist" depends="clean, package" /> <target name="clean" > <delete dir="${build.dir}" /> </target> <target name="init" > <mkdir dir="${build.dir}" /> </target> <target name="compile" > <javac debug="off" destdir="${build.dir}" source="1.6" srcdir="${src.dir}" target="1.6" /> </target> <target name="package" depends="init, compile" > <jar basedir="${build.dir}" destfile="${dist.dir}/core.jar" /> </target> </project> 
+2
Aug 08 '13 at 21:44
source share

If you just need core.jar from zxing, you can skip this process and get ready-made JAR files on the GettingStarted wiki page

Core.jar is a library solution for integrating zxing into your application.

(another option is Intent , but requires BarcodeScanner.apk)

For zxing2.2 you can get core.jar from the zxing Maven repository here

+2
Sep 26 '13 at 10:44 on
source share

Zxing 2.2 and higher do not include core / build.xml

If a source file is needed, I recommend using Zxing 2.1, which can be found here: https://code.google.com/p/zxing/downloads/detail?name=ZXing-2.2.zip&can=2&q=

0
Feb 23 '14 at 18:25
source share



All Articles