badaix/snapcast

Fails to cross-compile for android

rictoo opened this issue · 1 comments

I'm trying to cross-compile the Snapcast server for running on Android, but I'm running into an error on building.

Running ./gradlew build, I get multiple "Could not get resource [...] Username must not be null!" and compilation fails.

Steps to Reproduce

  1. git clone https://github.com/badaix/snapdroid.git
  2. git submodule update --init --recursive
  3. ./gradlew build

Environment details

  • OS: Ubuntu
  • Snapcast version: 0.27.0
  • Self compiled

> Configure project :Snapcast
WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats.
Checking the license for package NDK (Side by side) 25.1.8937393 in /home/rictoo/Android/Sdk/licenses
License for package NDK (Side by side) 25.1.8937393 accepted.
Preparing "Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)".
"Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)" ready.
Installing NDK (Side by side) 25.1.8937393 in /home/rictoo/Android/Sdk/ndk/25.1.8937393
"Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)" complete.
"Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)" finished.
Checking the license for package CMake 3.18.1 in /home/rictoo/Android/Sdk/licenses
License for package CMake 3.18.1 accepted.
Preparing "Install CMake 3.18.1 (revision: 3.18.1)".
"Install CMake 3.18.1 (revision: 3.18.1)" ready.
Installing CMake 3.18.1 in /home/rictoo/Android/Sdk/cmake/3.18.1
"Install CMake 3.18.1 (revision: 3.18.1)" complete.
"Install CMake 3.18.1 (revision: 3.18.1)" finished.
Checking the license for package Android SDK Build-Tools 33 in /home/rictoo/Android/Sdk/licenses
License for package Android SDK Build-Tools 33 accepted.
Preparing "Install Android SDK Build-Tools 33 (revision: 33.0.0)".
"Install Android SDK Build-Tools 33 (revision: 33.0.0)" ready.
Installing Android SDK Build-Tools 33 in /home/rictoo/Android/Sdk/build-tools/33.0.0
"Install Android SDK Build-Tools 33 (revision: 33.0.0)" complete.
"Install Android SDK Build-Tools 33 (revision: 33.0.0)" finished.
Checking the license for package Android SDK Platform 33 in /home/rictoo/Android/Sdk/licenses
License for package Android SDK Platform 33 accepted.
Preparing "Install Android SDK Platform 33 (revision: 2)".
"Install Android SDK Platform 33 (revision: 2)" ready.
Installing Android SDK Platform 33 in /home/rictoo/Android/Sdk/platforms/android-33
"Install Android SDK Platform 33 (revision: 2)" complete.
"Install Android SDK Platform 33 (revision: 2)" finished.

> Task :Snapcast:checkDebugAarMetadata FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':Snapcast:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':Snapcast:debugRuntimeClasspath'.
   > Could not resolve com.github.badaix:oboe:1.7.0.
     Required by:
         project :Snapcast
      > Could not resolve com.github.badaix:oboe:1.7.0.
         > Could not get resource 'https://maven.pkg.github.com/badaix/snapcast-deps/com/github/badaix/oboe/1.7.0/oboe-1.7.0.pom'.
            > Username must not be null!
   > Could not resolve com.github.badaix:boost:1.81.0.
     Required by:
         project :Snapcast
      > Could not resolve com.github.badaix:boost:1.81.0.
         > Could not get resource 'https://maven.pkg.github.com/badaix/snapcast-deps/com/github/badaix/boost/1.81.0/boost-1.81.0.pom'.
            > Username must not be null!
   > Could not resolve com.github.badaix:flac:1.4.2.
     Required by:
         project :Snapcast
      > Could not resolve com.github.badaix:flac:1.4.2.
         > Could not get resource 'https://maven.pkg.github.com/badaix/snapcast-deps/com/github/badaix/flac/1.4.2/flac-1.4.2.pom'.
            > Username must not be null!
   > Could not resolve com.github.badaix:ogg:1.3.5.
     Required by:
         project :Snapcast
      > Could not resolve com.github.badaix:ogg:1.3.5.
         > Could not get resource 'https://maven.pkg.github.com/badaix/snapcast-deps/com/github/badaix/ogg/1.3.5/ogg-1.3.5.pom'.
            > Username must not be null!
   > Could not resolve com.github.badaix:opus:1.1.2.
     Required by:
         project :Snapcast
      > Could not resolve com.github.badaix:opus:1.1.2.
         > Could not get resource 'https://maven.pkg.github.com/badaix/snapcast-deps/com/github/badaix/opus/1.1.2/opus-1.1.2.pom'.
            > Username must not be null!
   > Could not resolve com.github.badaix:soxr:0.1.3.
     Required by:
         project :Snapcast
      > Could not resolve com.github.badaix:soxr:0.1.3.
         > Could not get resource 'https://maven.pkg.github.com/badaix/snapcast-deps/com/github/badaix/soxr/0.1.3/soxr-0.1.3.pom'.
            > Username must not be null!
   > Could not resolve com.github.badaix:tremor:1.0.0.
     Required by:
         project :Snapcast
      > Could not resolve com.github.badaix:tremor:1.0.0.
         > Could not get resource 'https://maven.pkg.github.com/badaix/snapcast-deps/com/github/badaix/tremor/1.0.0/tremor-1.0.0.pom'.
            > Username must not be null!
   > Could not resolve com.github.badaix:vorbis:1.3.7.
     Required by:
         project :Snapcast
      > Could not resolve com.github.badaix:vorbis:1.3.7.
         > Could not get resource 'https://maven.pkg.github.com/badaix/snapcast-deps/com/github/badaix/vorbis/1.3.7/vorbis-1.3.7.pom'.
            > Username must not be null!

* 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

I've solved the issue by logging into Github.com, generating a Github token, and setting the GITHUB_USER and GITHUB_TOKEN environment variables before building.