question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

env.ANDROID_HOME compile error with spring boot

See original GitHub issue

compile error with javase version

I just want to use zxing on my web server to work with spring boot. but this library seens force me to install android development.

build.gradle

compile group: 'com.google.zxing', name: 'javase', version: '3.3.1'

error log

> Task :model:compileJava
Errors occurred while build effective model from /Users/kingyang/.gradle/caches/modules-2/files-2.1/com.google.zxing/javase/3.3.1/357121cdf3f89f63ddfaad18170612dcad0db947/javase-3.3.1.pom:
    'dependencyManagement.dependencies.dependency.systemPath' for com.google.android:android:jar must specify an absolute path but is ${env.ANDROID_HOME}/platforms/android-22/android.jar in com.google.zxing:javase:3.3.1
Errors occurred while build effective model from /Users/kingyang/.gradle/caches/modules-2/files-2.1/com.google.zxing/core/3.3.1/d1e7c4667f9dcdda30d09f3df7d1b44f65c44336/core-3.3.1.pom:
    'dependencyManagement.dependencies.dependency.systemPath' for com.google.android:android:jar must specify an absolute path but is ${env.ANDROID_HOME}/platforms/android-22/android.jar in com.google.zxing:core:3.3.1

> Task :compileJava
Errors occurred while build effective model from /Users/kingyang/.gradle/caches/modules-2/files-2.1/com.google.zxing/javase/3.3.1/357121cdf3f89f63ddfaad18170612dcad0db947/javase-3.3.1.pom:
    'dependencyManagement.dependencies.dependency.systemPath' for com.google.android:android:jar must specify an absolute path but is ${env.ANDROID_HOME}/platforms/android-22/android.jar in com.google.zxing:javase:3.3.1
Errors occurred while build effective model from /Users/kingyang/.gradle/caches/modules-2/files-2.1/com.google.zxing/core/3.3.1/d1e7c4667f9dcdda30d09f3df7d1b44f65c44336/core-3.3.1.pom:
    'dependencyManagement.dependencies.dependency.systemPath' for com.google.android:android:jar must specify an absolute path but is ${env.ANDROID_HOME}/platforms/android-22/android.jar in com.google.zxing:core:3.3.1
注: /Users/kingyang/dev/java/lipu/api/src/main/java/com/lipuwater/service/PushService.java

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
qianggetabacommented, Mar 4, 2020

I’ve got same issue, and solved by following steps, hope this helps.

  1. create empty file named android.jar
  2. replace systempath with above file absolute path in .gradle\caches\modules-2\files-2.1\com.google.zxing\zxing-parent\3.3.2\4ad323c509da2eff69fe7f02ef0f4e5910509206\zxing-parent-3.3.2.pom, content: <systemPath>/path/to/android.jar</systemPath>

ENV: windows 10 Intellij IDEA (only java) gradle, springboot, zxing3.3.2

0reactions
raduhrihoreanu99commented, Jun 24, 2021

I’ve got same issue, and solved by following steps, hope this helps.

  1. create empty file named android.jar
  2. replace systempath with above file absolute path in .gradle\caches\modules-2\files-2.1\com.google.zxing\zxing-parent\3.3.2\4ad323c509da2eff69fe7f02ef0f4e5910509206\zxing-parent-3.3.2.pom, content: /path/to/android.jar

ENV: windows 10 Intellij IDEA (only java) gradle, springboot, zxing3.3.2

I’ve solved the problem like qianggetaba said, except that I’ve replaced the systempath with the absolute path of the android.jar file from Android SDK. If you go to the file that qianggetaba specified and look for the systemPath tag, you’ll see a comment there that says: “ANDROID_HOME must be absolute, but redundant leading / may help Gradle Spring Boot plugin”. So I’ve replaced the old path, that in my case used {env.ANDROID_HOME}, with:

image

Then the error disappeared.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Failed to find 'ANDROID_HOME' environment variable
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory. You may not have...
Read more >
windows上gradle的springboot里zxing报错android:jar must ...
Gradle build breakage with 3.3.1 release - ${env.ANDROID_HOME} · env.ANDROID_HOME compile error with spring boot.
Read more >
windows上gradle的springboot里zxing报错 ... - CodeAntenna
env.ANDROID_HOME compile error with spring boot. 版权声明:本文为CSDN博主「c5113620」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
Read more >
How to obtain Spring library to set up Spring environment?
How to configure Spring Boot 1.2.0 for Servlet 3.0 and have m2e set Eclipse Facet to 3.0? How do I set environment variables...
Read more >
Spring Tips: Configuration
This mechanism - configuring Spring Boot with environment variables or program arguments - is a general-purpose. You can use it for any ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found