Esri/arcgis-maps-sdk-java-samples

Cant build with gradle

alaakaazaam opened this issue · 5 comments

I git cloned the source code, then from the directory, i launch gradle with this command : ./gradlew

All seems rigth (gradle downloads etc) until i stumble onto this :

FYI : im using java 11 on Ubuntu

openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1)

Stacktrace :
Welcome to Gradle 5.0!

Here are the highlights of this release:

  • Kotlin DSL 1.0
  • Task timeouts
  • Dependency alignment aka BOM support
  • Interactive gradle init

For more details see https://docs.gradle.org/5.0/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • Where:
    Build file '/home/stephane/Documents/dev/arcgis-runtime-samples-java/map/download-preplanned-map/build.gradle' line: 43

  • What went wrong:
    A problem occurred evaluating project ':download-preplanned-map'.

Could not resolve all files for configuration ':download-preplanned-map:natives'.
Could not resolve com.esri.arcgisruntime:arcgis-java-jnilibs:100.6.0-2490.
Required by:
project :download-preplanned-map
> Could not resolve com.esri.arcgisruntime:arcgis-java-jnilibs:100.6.0-2490.
> Could not get resource 'http://olympus.esri.com/artifactory/arcgisruntime-repo/com/esri/arcgisruntime/arcgis-java-jnilibs/100.6.0-2490/arcgis-java-jnilibs-100.6.0-2490.pom'.
> Could not GET 'http://olympus.esri.com/artifactory/arcgisruntime-repo/com/esri/arcgisruntime/arcgis-java-jnilibs/100.6.0-2490/arcgis-java-jnilibs-100.6.0-2490.pom'.
> olympus.esri.com
Could not resolve com.esri.arcgisruntime:arcgis-java-resources:100.6.0-2490.
Required by:
project :download-preplanned-map
> Could not resolve com.esri.arcgisruntime:arcgis-java-resources:100.6.0-2490.
> Could not get resource 'http://olympus.esri.com/artifactory/arcgisruntime-repo/com/esri/arcgisruntime/arcgis-java-resources/100.6.0-2490/arcgis-java-resources-100.6.0-2490.pom'.
> Could not GET 'http://olympus.esri.com/artifactory/arcgisruntime-repo/com/esri/arcgisruntime/arcgis-java-resources/100.6.0-2490/arcgis-java-resources-100.6.0-2490.pom'.
> olympus.esri.com

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2m 24s

Any insight would be greatly appreciated

I even tried with latest possible gradle version to date : 6.2

This time simply executing the command gradle within the source directory :

stephane@stephane-Atom:~/Documents/dev/arcgis-runtime-samples-java$ gradle
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • Where:
    Build file '/home/stephane/Documents/dev/arcgis-runtime-samples-java/map/download-preplanned-map/build.gradle' line: 43

  • What went wrong:
    A problem occurred evaluating project ':download-preplanned-map'.

Could not resolve all files for configuration ':download-preplanned-map:natives'.
Could not resolve com.esri.arcgisruntime:arcgis-java-jnilibs:100.6.0-2490.
Required by:
project :download-preplanned-map
> Could not resolve com.esri.arcgisruntime:arcgis-java-jnilibs:100.6.0-2490.
> Could not get resource 'http://olympus.esri.com/artifactory/arcgisruntime-repo/com/esri/arcgisruntime/arcgis-java-jnilibs/100.6.0-2490/arcgis-java-jnilibs-100.6.0-2490.pom'.
> Could not GET 'http://olympus.esri.com/artifactory/arcgisruntime-repo/com/esri/arcgisruntime/arcgis-java-jnilibs/100.6.0-2490/arcgis-java-jnilibs-100.6.0-2490.pom'.
> olympus.esri.com: Name or service not known
Could not resolve com.esri.arcgisruntime:arcgis-java-resources:100.6.0-2490.
Required by:
project :download-preplanned-map
> Could not resolve com.esri.arcgisruntime:arcgis-java-resources:100.6.0-2490.
> Could not get resource 'http://olympus.esri.com/artifactory/arcgisruntime-repo/com/esri/arcgisruntime/arcgis-java-resources/100.6.0-2490/arcgis-java-resources-100.6.0-2490.pom'.
> Could not GET 'http://olympus.esri.com/artifactory/arcgisruntime-repo/com/esri/arcgisruntime/arcgis-java-resources/100.6.0-2490/arcgis-java-resources-100.6.0-2490.pom'.
> olympus.esri.com

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 43s
stephane@stephane-Atom:~/Documents/dev/arcgis-runtime-samples-java$

Please help

@alaakaazaam there is a clue in the error message which tells me the problem:

Could not resolve com.esri.arcgisruntime:arcgis-java-jnilibs:100.6.0-2490.

You need to be using the latest version of the master branch. I suspect you are using a very old dev branch as 100.6.0-2490 is an internal esri build you won't have access to. The purpose of the dev branch is that this is an area we prepare samples for the next release, whilst letting you get a picture of what is coming.

To resolve the issue, switch to the master branch and pull all the latest code. Near the top of the build.gradle script for your app you should see the following:

ext { arcgisVersion = '100.7.0' }

Let me know if it fixes the issue.

I m on several issues at the same time.

I checked out the master branch and did pulled everything : nothing more to update but still the error appears.

I will give it another try tomorrow

Thanks for the tip !

@alaakaazaam let me know how you get on. Your build script definitely contains an outdated version number from another branch. Your grade.build file should be referencing 100.7.0. Once you have that fixed, it will work.

Finally it work ! Thanks for all