Building BarcodeScanner app error

499 views
Skip to first unread message

楊文齊

unread,
Sep 5, 2015, 10:49:15 PM9/5/15
to zxing
hello, typing mvn package android:app to build Barcode Scanner app, I got this warning message, how do i fix it ?

[WARNING] The POM for com.google.zxing:core:jar:3.2.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.google.zxing:android-core:jar:3.2.2-SNAPSHOT is missing, no dependency information available

[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Android Barcode Scanner app 4.7.4
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.767 s
[INFO] Finished at: 2015-09-06T10:38:37+08:00
[INFO] Final Memory: 18M/168M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project android: Could not resolve dependencies for project com.google.zxing:android:apk:4.7.4: The following artifacts could not be resolved: com.google.zxing:core:jar:3.2.2-SNAPSHOT, com.google.zxing:android-core:jar:3.2.2-SNAPSHOT: Could not find artifact com.google.zxing:core:jar:3.2.2-SNAPSHOT -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException


POM in android folder:

<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2013 ZXing authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>android</artifactId>
<version>4.7.4</version>
<packaging>apk</packaging>

<dependencies>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>android-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
</dependency>
</dependencies>

<parent>
<groupId>com.google.zxing</groupId>
<artifactId>zxing-parent</artifactId>
<version>3.2.1</version>
</parent>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

<name>Android Barcode Scanner app</name>
<description>Provides the Android app "Barcode Scanner"</description>

</project>

楊文齊

unread,
Sep 6, 2015, 4:19:08 PM9/6/15
to zxing

> <dependencies>
> <dependency>
> <groupId>com.google.zxing</groupId>
> <artifactId>core</artifactId>

<version>use the release version</version>


> </dependency>
> <dependency>
> <groupId>com.google.zxing</groupId>
> <artifactId>android-core</artifactId>

</version>use the release version</version>
> </dependency>

Lachezar Dobrev

unread,
Sep 7, 2015, 5:21:51 AM9/7/15
to 楊文齊, zxing
  You need to compile the core ZXing projects: core, android-core.


--
You received this message because you are subscribed to the Google Groups "zxing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zxing+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lachezar Dobrev

unread,
Sep 7, 2015, 7:18:53 AM9/7/15
to 楊文齊, zxing
  You should use 'mvn install' to put the artefacts in your local repository so that they can be found when building the android application.

2015-09-07 13:05 GMT+03:00 楊文齊 <logi...@gmail.com>:
I have built the core and android-core modules, and got SNAPSHOT.jar files.
but the maven can't find them when building the android module.
So I change the artifact version in pom file, it works.
Does it mean that if i want to use the SNAPSHOT.jar, I should setting up the local repository??
By the way, thanks for answering my question. : )

Lachezar Dobrev於 2015年9月7日星期一 UTC+8下午5時21分51秒寫道:

Sean Owen

unread,
Sep 7, 2015, 7:44:14 AM9/7/15
to zxing, logi...@gmail.com
That's right. I'll also go ahead and post a SNAPSHOT build of 3.2.2 to Maven.

Braden Katzman

unread,
Sep 16, 2015, 12:15:46 AM9/16/15
to zxing, logi...@gmail.com
I'm having this same issue, and am still receiving the same error message when I use mvn install.

I've compiled the core projects by running mvn package in the root directory, but still receive this error when trying to build the barcode scanner.

Any other tips for why this is happening? In my pom.xml, the version is listed as 3.2.1 but the error message shows version 3.2.2, but changing that in the .xml file did not help.

Thank you in advance.
Reply all
Reply to author
Forward
0 new messages