Archive 17/01/2023.

Error building new project for Android using gradlew

cyberix3d

Hello,
I was able to successfully build the Urho3D library using “gradlew build” in the Urho3D directory.
However, when I am trying to create a new project and build it for Android, I am encountering an error.

First, I attempted to create a new project using rake:
“rake new[testAndroid,c:/trunk/Urho3DApps]”

Then, I attempted to run “gradlew build” and received the following error:

* Where:
Build file 'C:\trunk\Urho3DApps\testAndroid\app\build.gradle.kts' line: 60

* What went wrong:
Script compilation error:

  Line 60:             setBuildStagingDirectory(buildStagingDir)
                       ^ Unresolved reference: setBuildStagingDirectory

I then changed “setBuildStagingDirectory” to “buildStagingDirectory” and attempted to run “gradlew build” again, but received the following error:

WARNING:: Please remove usages of `jcenter()` Maven repository from your build scripts and migrate your build to other Maven repositories.
This repository is deprecated and it will be shut down in the future.
See http://developer.android.com/r/tools/jcenter-end-of-service for more information.
Currently detected usages in: root project 'testAndroid', project ':app'

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:generateJsonModelDebug'.
> Could not create task ':app:unzipJniDebug'.
   > Could not resolve all files for configuration ':app:urhoDebugImpl'.
      > Could not find io.urho3d:urho3d-lib-static-debug:1.10.0-SNAPSHOT.
        Searched in the following locations:
          - https://dl.google.com/dl/android/maven2/io/urho3d/urho3d-lib-static-debug/1.10.0-SNAPSHOT/maven-metadata.xml
          - https://dl.google.com/dl/android/maven2/io/urho3d/urho3d-lib-static-debug/1.10.0-SNAPSHOT/urho3d-lib-static-debug-1.10.0-SNAPSHOT.pom
          - https://jcenter.bintray.com/io/urho3d/urho3d-lib-static-debug/1.10.0-SNAPSHOT/maven-metadata.xml
          - https://jcenter.bintray.com/io/urho3d/urho3d-lib-static-debug/1.10.0-SNAPSHOT/urho3d-lib-static-debug-1.10.0-SNAPSHOT.pom
          - file:/C:/Users/cyberix3d/.m2/repository/io/urho3d/urho3d-lib-static-debug/1.10.0-SNAPSHOT/maven-metadata.xml
          - file:/C:/Users/cyberix3d/.m2/repository/io/urho3d/urho3d-lib-static-debug/1.10.0-SNAPSHOT/urho3d-lib-static-debug-1.10.0-SNAPSHOT.pom
        Required by:
            project :app

* 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 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 19s

I am using CMake version 3.17.3, Android SDK 30, and NDK r21d.

Could someone please tell me what the problem is?