3

I am trying to build the Zxing android app (not the libraries) using the instructions here. I was able to build the jars but cannot build the app itself. When I run mvn package android:apk I get the following error:

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for com.google.android:android:jar is missing. @ line 34, column 17
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.google.zxing:android:4.7.9 (c:\Git\Nucleus\zxing\android\pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for com.google.android:android:jar is missing. @ line 34, column 17
[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/ProjectBuildingException

Any help would be greatly appreciated. Even better would be some instructions on building the app with Android Studio.

Ginger McMurray
  • 1,275
  • 2
  • 20
  • 42
  • 1
    If you go into the `pom.xml` that contains `com.google.android:android` dependency, does it have a version tag? What happens if you add `4.1.1.4` and try the Maven install again? – Matt Dec 01 '20 at 16:05
  • @Matt Yours looks as the correct answer. **You should post this as an answer**, so I can retract mine and upvote yours. After the bounty has been assigned (because otherwise we can't do it), the question should be closed as a duplicate. Could you include the original answer link from my answer in yours, and comment-ping me afterwards? – LSerni Dec 03 '20 at 12:12
  • 1
    @LSerni Added an answer; I appreciate you letting me know. – Matt Dec 03 '20 at 12:53

2 Answers2

3

You can see where the error is from the following line

[ERROR] 'dependencies.dependency.version' for com.google.android:android:jar is missing. @ line 34, column 17

You will need to add a valid <version> tag to the dependency. Checking the Maven repository for the artifact, we can see the latest version is 4.1.14.

Ensure your POM containing the dependency looks like

<platform.version>4.1.1.4</platform.version>

This was also mentioned as an answer here so I imagine you're having the same problem.

Matt
  • 2,953
  • 3
  • 27
  • 46
0

Check if you haven't missed <dependencyManagement> tag around dependencies.

Also you can check this answer for better understanding.

SKarpov
  • 131
  • 2