docker-android-nodejs icon indicating copy to clipboard operation
docker-android-nodejs copied to clipboard

Running Gradle build - failed

Open MrKribel opened this issue 3 years ago • 1 comments

Hi, this is my Dockerfile:

FROM beevelop/android-nodejs:latest as builder-base
COPY . .
RUN npm install 
RUN npx cap open android
RUN npm run build
RUN npx cap sync android
RUN echo y | keytool -genkeypair -dname "cn=Alex, ou=FORST, o=FORST, c=RU" -alias android_key -keypass 'lol' -keystore ANDROID.keystore -storepass 'lol' -validity 20000
RUN npx cap build android --keystorepath ANDROID.keystore --keystorepass  'lol' --keystorealias android_key --keystorealiaspass 'lol' --androidreleasetype APK

When I run it, I get an error:

 ---> Running in 02813ba55e6c
✖ Running Gradle build - failed!
[error] Downloading https://services.gradle.org/distributions/gradle-7.4.2-all.zip
        ...............10%...............20%...............30%...............40%...............50%................60%...............70%...............80%...............90%...............100%
        
        Welcome to Gradle 7.4.2!
        
        Here are the highlights of this release:
        - Aggregated test and JaCoCo reports
        - Marking additional test source directories as tests in IntelliJ
        - Support for Adoptium JDKs in Java toolchains
        
        For more details see https://docs.gradle.org/7.4.2/release-notes.html
        
        Starting a Gradle Daemon (subsequent builds will be faster)
        
        > Configure project :app
        WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats.
        
        > Configure project :capacitor-cordova-android-plugins
        WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats.
        Checking the license for package Android Emulator in /opt/android/licenses
        Warning: License for package Android Emulator not accepted.
        Checking the license for package Android SDK Tools in /opt/android/licenses
        Warning: License for package Android SDK Tools not accepted.
        Checking the license for package Android SDK Build-Tools 30.0.3 in /opt/android/licenses
        Warning: License for package Android SDK Build-Tools 30.0.3 not accepted.
        
        FAILURE: Build failed with an exception.
        
        * What went wrong:
        Could not determine the dependencies of task ':app:lintVitalReportRelease'.
        > Failed to install the following Android SDK packages as some licences have not been accepted.
        build-tools;30.0.3 Android SDK Build-Tools 30.0.3
        emulator Android Emulator
        tools Android SDK Tools
        To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
        All licenses can be accepted using the sdkmanager command line tool:
        sdkmanager.bat --licenses
        Or, to transfer the license agreements from one workstation to another, see https://developer.android.com/studio/intro/update.html#download-with-gradle
        
        Using Android SDK: /opt/android
        
        * 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 1m 6s

How do I fix it?

MrKribel avatar Jan 25 '23 11:01 MrKribel

@MrKribel Thank you for raising the issue. This is related to the Android licenses that need to be accepted (unfortunately I can't do this for you). I added a description to the base image: https://github.com/beevelop/docker-android#or-use-it-as-a-base-image

beevelop avatar Apr 18 '23 20:04 beevelop