
> echo Attempting build for yanukadeneth99-Simple-Application-Cordova with Node 20 and JDK 17
Attempting build for yanukadeneth99-Simple-Application-Cordova with Node 20 and JDK 17

> docker run --rm -v /home/ubuntu/storage/cordova_assets/extracted/yanukadeneth99-Simple-Application-Cordova/Simple-Application-Cordova-389661b4a3e5969423b3712759596b6be19f055d:/source:ro -v /home/ubuntu/BachelorsThesis/scripts/cordova/output/yanukadeneth99-Simple-Application-Cordova:/output -v /home/ubuntu/.npm:/root/.npm cordova-android:20-jdk17 bash -c set -e
            cp -r /source/. /app
            cd /app
            rm -rf platforms plugins node_modules || true
            rm -rf $GRADLE_USER_HOME || true
            mkdir -p $GRADLE_USER_HOME

            # unset Gradle options
            unset JAVA_OPTS

            # install deps
            if [ -f yarn.lock ]; then
                yarn install --ignore-scripts
            else
                npm install --ignore-scripts
            fi

            # ensure android platform
            cordova platform add android
            cordova prepare android

            # ---- PATCH ROOT GRADLE FILES (CRITICAL FIX) ----
            for f in platforms/android/build.gradle platforms/android/CordovaLib/build.gradle; do
                if [ -f "$f" ]; then
                    # add missing repositories to buildscript + allprojects
                    sed -i '/buildscript[[:space:]]*{/a\
                repositories {\
                    google()\
                    mavenCentral()\
                    maven { url "https://plugins.gradle.org/m2/" }\
                    maven { url "https://maven.aliyun.com/repository/public" }\
                    maven { url "https://jcenter.bintray.com/" }\
                    maven { url "https://jitpack.io" }\
                }\
            ' "$f" || true

                    sed -i '/allprojects[[:space:]]*{/a\
                repositories {\
                    google()\
                    mavenCentral()\
                    maven { url "https://plugins.gradle.org/m2/" }\
                    maven { url "https://maven.aliyun.com/repository/public" }\
                    maven { url "https://jcenter.bintray.com/" }\
                    maven { url "https://jitpack.io" }\
                }\
            ' "$f" || true
                fi
            done

            # ---- FIX versioncompare (very common failure) ----
            grep -RIl 'com.g00fy2:versioncompare:1.3.4' platforms/android 2>/dev/null | \
            xargs -r sed -i 's/com.g00fy2:versioncompare:1.3.4/io.github.g00fy2:versioncompare:1.5.0/g' || true

            # ---- fix versioncompare imports (CRITICAL) ----
            find platforms/android \( -name "*.gradle" -o -name "*.gradle.kts" \) -print0 | \
            xargs -0 sed -i 's/import com\.g00fy2\.versioncompare\.Version/import io.github.g00fy2.versioncompare.Version/g' || true

            # ---- OPTIONAL: remove illegal JVM args ----
            find platforms/android -type f -exec sed -i 's/--illegal-access=permit//g' {} + || true

            # ---- JDK 8 specific patch (minimal, no overwrite!) ----
            if [ \"17\" = "8" ]; then
                # ensure older sdk usage (do NOT overwrite build.gradle anymore)
                find platforms/android -name "build.gradle" -exec \
                    sed -i 's/compileSdkVersion [0-9]\+/compileSdkVersion 30/g' {} \; || true

                find platforms/android -name "build.gradle" -exec \
                    sed -i 's/targetSdkVersion [0-9]\+/targetSdkVersion 30/g' {} \; || true
            fi

            # ---- android sdk path ----
            echo "sdk.dir=$ANDROID_HOME" > platforms/android/local.properties

            # ---- force APK output (suppress AAB generation) ----
            echo "android.bundle.enableAll=false" >> platforms/android/gradle.properties

            # ---- enable ABI splits ----
            if grep -q 'splits' platforms/android/app/build.gradle 2>/dev/null; then
                sed -i 's/enable false/enable true/' platforms/android/app/build.gradle || true
            else
                sed -i '/^android[[:space:]]*{/a\    splits {\n        abi {\n            reset()\n            enable true\n            universalApk false\n            include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"\n        }\n    }' platforms/android/app/build.gradle || true
            fi

            # ---- build debug APK ----
            cordova build android --debug --no-interactive --verbose

            cp platforms/android/app/build/outputs/apk/debug/*.apk /output/

            # ---- copy TPL metadata ----
            [ -f config.xml ] && cp config.xml /output/ || true
            [ -f plugins/fetch.json ] && cp plugins/fetch.json /output/ || true
            [ -f plugins/android.json ] && cp plugins/android.json /output/ || true
            [ -f platforms/android/app/build.gradle ] && cp platforms/android/app/build.gradle /output/app-build.gradle || true
            [ -f platforms/android/build.gradle ] && cp platforms/android/build.gradle /output/root-build.gradle || true
            [ -f platforms/android/settings.gradle ] && cp platforms/android/settings.gradle /output/ || true
            [ -f package.json ] && cp package.json /output/ || true
            [ -f package-lock.json ] && cp package-lock.json /output/ || true
            [ -f yarn.lock ] && cp yarn.lock /output/ || true
            [ -f pnpm-lock.yaml ] && cp pnpm-lock.yaml /output/ || true
            mkdir -p /output/plugin_manifests
            find plugins -name "plugin.xml" 2>/dev/null | while read f; do cp "$f" /output/plugin_manifests/$(echo "$f" | tr '/' '_') 2>/dev/null; done || true
            find plugins -name "*.gradle" 2>/dev/null | while read f; do cp "$f" /output/ 2>/dev/null; done || true
            find platforms/android -name "*.gradle" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/ 2>/dev/null; done || true
            mkdir -p /output/libs
            find plugins platforms/android -name "*.jar" -not -name "gradle-wrapper.jar" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/libs/ 2>/dev/null; done || true
            find plugins platforms/android -name "*.aar" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/libs/ 2>/dev/null; done || true
            find plugins platforms/android -name "*.so" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/libs/ 2>/dev/null; done || true
            
npm warn deprecated asar@3.2.0: Please use @electron/asar moving forward.  There is no API change, just a package name change
npm warn deprecated electron-osx-sign@0.5.0: Please use @electron/osx-sign moving forward. Be aware the API is slightly different

added 369 packages, and audited 370 packages in 9s

42 packages are looking for funding
  run `npm fund` for details

34 vulnerabilities (1 low, 11 moderate, 21 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
Using cordova-fetch for cordova-android@^12.0.1
Adding android project...
Creating Cordova project for the Android platform:
	Path: platforms/android
	Package: com.example.simpleapp
	Name: SimpleApplication
	Activity: MainActivity
	Android Target SDK: android-33
	Android Compile SDK: 33
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@12.0.1
No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking for saved platforms that haven't been added to the project
Loaded API for android project /app/platforms/android/cordova/Api.js
Checking for saved plugins that haven't been added to the project
Generating platform-specific config.xml from defaults for android at /app/platforms/android/app/src/main/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
[Gradle Properties] Preparing Configuration
[Gradle Properties] Appending default configuration properties
[Gradle Properties] Updating Gradle property "android.enableJetifier" with the value of "true"
[Gradle Properties] Appending custom configuration properties
[Gradle Properties] Updating and Saving File
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/app/src/main/assets/www
  copy  platforms/android/platform_www/cordova.js platforms/android/app/src/main/assets/www/cordova.js (updated file)
Wrote out android application name "SimpleApplication" to /app/platforms/android/app/src/main/res/values/strings.xml
The "AndroidWindowSplashScreenAnimatedIcon" is undefined. Cordova's default will be used.
Wrote out Android application SplashScreen Color to /app/platforms/android/app/src/main/res/values/colors.xml
The "AndroidWindowSplashScreenBrandingImage" is undefined. Cordova's default will be used.
Wrote out Android application SplashScreen Icon Color to /app/platforms/android/app/src/main/res/values/colors.xml
Wrote out Android application themes to /app/platforms/android/app/src/main/res/values/themes.xml
[Cordova Gradle Config] Setting "PACKAGE_NAMESPACE" to com.example.simpleapp
[Cordova Gradle Config] Saving File
android-versionCode not found in config.xml. Generating a code based on version in config.xml (1.0.0): 10000
This app does not have launcher icons defined
This app does not have additional resource files defined
Prepared android project successfully
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
Checking Java JDK and Android SDK versions
ANDROID_HOME=/opt/android (recommended setting)
ANDROID_SDK_ROOT=/opt/android (DEPRECATED)
Using Android SDK: /opt/android

Welcome to Gradle 8.5!

Here are the highlights of this release:
 - Support for running on Java 21
 - Faster first use with Kotlin DSL
 - Improved error and warning messages

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

To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.5/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build 
> Task :wrapper

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

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

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 10s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
Gradle Distribution URL: https://services.gradle.org/distributions/gradle-7.6-all.zip
Running Gradle Build: /app/platforms/android/gradlew -b /app/platforms/android/build.gradle cdvBuildDebug
Downloading https://services.gradle.org/distributions/gradle-7.6-all.zip
...............10%................20%................30%................40%...............50%................60%................70%................80%...............90%................100%

Welcome to Gradle 7.6!

Here are the highlights of this release:
 - Added support for Java 19.
 - Introduced `--rerun` flag for individual task rerun.
 - Improved dependency block for test suites to be strongly typed.
 - Added a pluggable system for Java toolchains provisioning.

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

To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.6/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build 
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :CordovaLib:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :CordovaLib:packageDebugRenderscript
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:generateDebugBuildConfig
> Task :app:javaPreCompileDebug
> Task :app:generateDebugResValues
> Task :CordovaLib:writeDebugAarMetadata

> Task :CordovaLib:compileDebugRenderscript
The RenderScript APIs are deprecated. They will be removed in Android Gradle plugin 9.0. See the following link for a guide to migrate from RenderScript: https://developer.android.com/guide/topics/renderscript/migrate

> Task :CordovaLib:generateDebugResValues
> Task :CordovaLib:generateDebugResources
> Task :app:checkDebugAarMetadata
> Task :CordovaLib:packageDebugResources
> Task :app:mapDebugSourceSetPaths
> Task :app:generateDebugResources
> Task :app:createDebugCompatibleScreenManifests
> Task :app:extractDeepLinksDebug
> Task :CordovaLib:extractDeepLinksDebug
> Task :CordovaLib:processDebugManifest
> Task :app:mergeDebugResources
> Task :CordovaLib:compileDebugLibraryResources
> Task :app:processDebugMainManifest
> Task :app:processDebugManifest
> Task :CordovaLib:generateDebugBuildConfig
> Task :CordovaLib:javaPreCompileDebug
> Task :app:mergeDebugShaders
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:parseDebugLocalResources
> Task :CordovaLib:mergeDebugShaders
> Task :CordovaLib:compileDebugShaders NO-SOURCE
> Task :CordovaLib:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:packageDebugAssets
> Task :app:mergeDebugAssets
> Task :app:compressDebugAssets
> Task :app:processDebugManifestForPackage
> Task :app:processDebugJavaRes NO-SOURCE
> Task :CordovaLib:generateDebugRFile
> Task :CordovaLib:processDebugJavaRes
> Task :app:processDebugResources

> Task :CordovaLib:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :CordovaLib:bundleLibCompileToJarDebug
> Task :CordovaLib:bundleLibResDebug
> Task :app:checkDebugDuplicateClasses
> Task :app:compileDebugJavaWithJavac
> Task :app:desugarDebugFileDependencies
> Task :app:mergeDebugJavaResource
> Task :CordovaLib:bundleLibRuntimeToDirDebug
> Task :app:dexBuilderDebug
> Task :app:mergeDebugJniLibFolders
> Task :CordovaLib:mergeDebugJniLibFolders
> Task :CordovaLib:mergeDebugNativeLibs NO-SOURCE
> Task :CordovaLib:copyDebugJniLibsProjectOnly
> Task :app:mergeProjectDexDebug
> Task :app:mergeDebugNativeLibs NO-SOURCE
> Task :app:stripDebugDebugSymbols NO-SOURCE
> Task :app:validateSigningDebug
> Task :app:writeDebugAppMetadata
> Task :app:writeDebugSigningConfigVersions
> Task :app:mergeLibDexDebug
> Task :app:mergeExtDexDebug
> Task :app:packageDebug
> Task :app:createDebugApkListingFileRedirect
> Task :app:assembleDebug
> Task :app:cdvBuildDebug

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.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1m 54s
50 actionable tasks: 50 executed
Built the following apk(s): 
	/app/platforms/android/app/build/outputs/apk/debug/app-armeabi-v7a-debug.apk
	/app/platforms/android/app/build/outputs/apk/debug/app-x86-debug.apk
	/app/platforms/android/app/build/outputs/apk/debug/app-x86_64-debug.apk
	/app/platforms/android/app/build/outputs/apk/debug/app-arm64-v8a-debug.apk
No scripts found for hook "after_compile".
No scripts found for hook "after_build".

> docker run --rm -v /home/ubuntu/storage/cordova_assets/extracted/yanukadeneth99-Simple-Application-Cordova/Simple-Application-Cordova-389661b4a3e5969423b3712759596b6be19f055d:/source:ro -v /home/ubuntu/BachelorsThesis/scripts/cordova/output/yanukadeneth99-Simple-Application-Cordova:/output -v /home/ubuntu/.npm:/root/.npm cordova-android:20-jdk17 bash -c set -e
            cp -r /source/. /app
            cd /app
            rm -rf platforms plugins node_modules || true
            rm -rf $GRADLE_USER_HOME || true
            mkdir -p $GRADLE_USER_HOME

            # unset Gradle options
            unset JAVA_OPTS

            # install deps
            if [ -f yarn.lock ]; then
                yarn install --ignore-scripts
            else
                npm install --ignore-scripts
            fi

            # ensure android platform
            cordova platform add android
            cordova prepare android

            # ---- PATCH ROOT GRADLE FILES (CRITICAL FIX) ----
            for f in platforms/android/build.gradle platforms/android/CordovaLib/build.gradle; do
                if [ -f "$f" ]; then
                    sed -i '/buildscript[[:space:]]*{/a\
                repositories {\
                    google()\
                    mavenCentral()\
                    maven { url "https://plugins.gradle.org/m2/" }\
                    maven { url "https://maven.aliyun.com/repository/public" }\
                    maven { url "https://jcenter.bintray.com/" }\
                    maven { url "https://jitpack.io" }\
                }\
            ' "$f" || true

                    sed -i '/allprojects[[:space:]]*{/a\
                repositories {\
                    google()\
                    mavenCentral()\
                    maven { url "https://plugins.gradle.org/m2/" }\
                    maven { url "https://maven.aliyun.com/repository/public" }\
                    maven { url "https://jcenter.bintray.com/" }\
                    maven { url "https://jitpack.io" }\
                }\
            ' "$f" || true
                fi
            done

            # ---- FIX versioncompare (very common failure) ----
            grep -RIl 'com.g00fy2:versioncompare:1.3.4' platforms/android 2>/dev/null | \
            xargs -r sed -i 's/com.g00fy2:versioncompare:1.3.4/io.github.g00fy2:versioncompare:1.5.0/g' || true

            # ---- fix versioncompare imports (CRITICAL) ----
            find platforms/android \( -name "*.gradle" -o -name "*.gradle.kts" \) -print0 | \
            xargs -0 sed -i 's/import com\.g00fy2\.versioncompare\.Version/import io.github.g00fy2.versioncompare.Version/g' || true

            # ---- OPTIONAL: remove illegal JVM args ----
            find platforms/android -type f -exec sed -i 's/--illegal-access=permit//g' {} + || true

            # ---- JDK 8 specific patch ----
            if [ \"17\" = "8" ]; then
                find platforms/android -name "build.gradle" -exec \
                    sed -i 's/compileSdkVersion [0-9]\+/compileSdkVersion 30/g' {} \; || true

                find platforms/android -name "build.gradle" -exec \
                    sed -i 's/targetSdkVersion [0-9]\+/targetSdkVersion 30/g' {} \; || true
            fi

            # ---- android sdk path ----
            echo "sdk.dir=$ANDROID_HOME" > platforms/android/local.properties

            # ---- force APK output (suppress AAB generation) ----
            echo "android.bundle.enableAll=false" >> platforms/android/gradle.properties

            # ---- enable ABI splits ----
            if grep -q 'splits' platforms/android/app/build.gradle 2>/dev/null; then
                sed -i 's/enable false/enable true/' platforms/android/app/build.gradle || true
            else
                sed -i '/^android[[:space:]]*{/a\    splits {\n        abi {\n            reset()\n            enable true\n            universalApk false\n            include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"\n        }\n    }' platforms/android/app/build.gradle || true
            fi

            # ---- enable R8 / minification ----
            sed -i 's/minifyEnabled false/minifyEnabled true/' platforms/android/app/build.gradle || true

            # ---- sign release with debug key ----
            sed -i '/buildTypes/,/}/s/release {/release {\n            signingConfig signingConfigs.debug/' platforms/android/app/build.gradle || true

            # ---- build release APK ----
            cordova build android --release --no-interactive --verbose

            cp platforms/android/app/build/outputs/apk/release/*.apk /output/r8/

            # ---- copy TPL metadata ----
            [ -f config.xml ] && cp config.xml /output/r8/ || true
            [ -f plugins/fetch.json ] && cp plugins/fetch.json /output/r8/ || true
            [ -f plugins/android.json ] && cp plugins/android.json /output/r8/ || true
            [ -f platforms/android/app/build.gradle ] && cp platforms/android/app/build.gradle /output/r8/app-build.gradle || true
            [ -f platforms/android/build.gradle ] && cp platforms/android/build.gradle /output/r8/root-build.gradle || true
            [ -f platforms/android/settings.gradle ] && cp platforms/android/settings.gradle /output/r8/ || true
            [ -f package.json ] && cp package.json /output/r8/ || true
            [ -f package-lock.json ] && cp package-lock.json /output/r8/ || true
            [ -f yarn.lock ] && cp yarn.lock /output/r8/ || true
            [ -f pnpm-lock.yaml ] && cp pnpm-lock.yaml /output/r8/ || true
            mkdir -p /output/r8/plugin_manifests
            find plugins -name "plugin.xml" 2>/dev/null | while read f; do cp "$f" /output/r8/plugin_manifests/$(echo "$f" | tr '/' '_') 2>/dev/null; done || true
            find plugins -name "*.gradle" 2>/dev/null | while read f; do cp "$f" /output/r8/ 2>/dev/null; done || true
            find platforms/android -name "*.gradle" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/ 2>/dev/null; done || true
            mkdir -p /output/r8/libs
            find plugins platforms/android -name "*.jar" -not -name "gradle-wrapper.jar" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/libs/ 2>/dev/null; done || true
            find plugins platforms/android -name "*.aar" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/libs/ 2>/dev/null; done || true
            find plugins platforms/android -name "*.so" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/libs/ 2>/dev/null; done || true
            
npm warn deprecated asar@3.2.0: Please use @electron/asar moving forward.  There is no API change, just a package name change
npm warn deprecated electron-osx-sign@0.5.0: Please use @electron/osx-sign moving forward. Be aware the API is slightly different

added 369 packages, and audited 370 packages in 8s

42 packages are looking for funding
  run `npm fund` for details

34 vulnerabilities (1 low, 11 moderate, 21 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
Using cordova-fetch for cordova-android@^12.0.1
Adding android project...
Creating Cordova project for the Android platform:
	Path: platforms/android
	Package: com.example.simpleapp
	Name: SimpleApplication
	Activity: MainActivity
	Android Target SDK: android-33
	Android Compile SDK: 33
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@12.0.1
No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking for saved platforms that haven't been added to the project
Loaded API for android project /app/platforms/android/cordova/Api.js
Checking for saved plugins that haven't been added to the project
Generating platform-specific config.xml from defaults for android at /app/platforms/android/app/src/main/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
[Gradle Properties] Preparing Configuration
[Gradle Properties] Appending default configuration properties
[Gradle Properties] Updating Gradle property "android.enableJetifier" with the value of "true"
[Gradle Properties] Appending custom configuration properties
[Gradle Properties] Updating and Saving File
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/app/src/main/assets/www
  copy  platforms/android/platform_www/cordova.js platforms/android/app/src/main/assets/www/cordova.js (updated file)
Wrote out android application name "SimpleApplication" to /app/platforms/android/app/src/main/res/values/strings.xml
The "AndroidWindowSplashScreenAnimatedIcon" is undefined. Cordova's default will be used.
Wrote out Android application SplashScreen Color to /app/platforms/android/app/src/main/res/values/colors.xml
The "AndroidWindowSplashScreenBrandingImage" is undefined. Cordova's default will be used.
Wrote out Android application SplashScreen Icon Color to /app/platforms/android/app/src/main/res/values/colors.xml
Wrote out Android application themes to /app/platforms/android/app/src/main/res/values/themes.xml
[Cordova Gradle Config] Setting "PACKAGE_NAMESPACE" to com.example.simpleapp
[Cordova Gradle Config] Saving File
android-versionCode not found in config.xml. Generating a code based on version in config.xml (1.0.0): 10000
This app does not have launcher icons defined
This app does not have additional resource files defined
Prepared android project successfully
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
Checking Java JDK and Android SDK versions
ANDROID_HOME=/opt/android (recommended setting)
ANDROID_SDK_ROOT=/opt/android (DEPRECATED)
Using Android SDK: /opt/android

Welcome to Gradle 8.5!

Here are the highlights of this release:
 - Support for running on Java 21
 - Faster first use with Kotlin DSL
 - Improved error and warning messages

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

To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.5/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build 
> Task :wrapper

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

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

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 11s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
Gradle Distribution URL: https://services.gradle.org/distributions/gradle-7.6-all.zip
Running Gradle Build: /app/platforms/android/gradlew -b /app/platforms/android/build.gradle :app:bundleRelease
Downloading https://services.gradle.org/distributions/gradle-7.6-all.zip
...............10%................20%................30%................40%...............50%................60%................70%................80%...............90%................100%

Welcome to Gradle 7.6!

Here are the highlights of this release:
 - Added support for Java 19.
 - Introduced `--rerun` flag for individual task rerun.
 - Improved dependency block for test suites to be strongly typed.
 - Added a pluggable system for Java toolchains provisioning.

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

To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.6/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build 
> Task :app:preBuild UP-TO-DATE
> Task :app:preReleaseBuild UP-TO-DATE
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preReleaseBuild UP-TO-DATE
> Task :CordovaLib:packageReleaseRenderscript
> Task :app:compileReleaseRenderscript NO-SOURCE
> Task :app:generateReleaseResValues

> Task :CordovaLib:compileReleaseRenderscript
The RenderScript APIs are deprecated. They will be removed in Android Gradle plugin 9.0. See the following link for a guide to migrate from RenderScript: https://developer.android.com/guide/topics/renderscript/migrate

> Task :CordovaLib:generateReleaseResValues
> Task :CordovaLib:generateReleaseResources
> Task :CordovaLib:packageReleaseResources
> Task :app:mapReleaseSourceSetPaths
> Task :app:generateReleaseResources
> Task :app:createReleaseCompatibleScreenManifests
> Task :app:extractDeepLinksRelease
> Task :CordovaLib:extractDeepLinksRelease
> Task :CordovaLib:compileReleaseLibraryResources
> Task :app:mergeReleaseResources
> Task :CordovaLib:compileReleaseAidl NO-SOURCE
> Task :CordovaLib:processReleaseManifest
> Task :CordovaLib:generateReleaseBuildConfig
> Task :app:processReleaseMainManifest
> Task :app:processReleaseManifest
> Task :app:processApplicationManifestReleaseForBundle
> Task :app:bundleReleaseResources
> Task :CordovaLib:javaPreCompileRelease
> Task :CordovaLib:parseReleaseLocalResources
> Task :app:checkReleaseDuplicateClasses
> Task :app:compileReleaseAidl NO-SOURCE
> Task :app:generateReleaseBuildConfig
> Task :app:javaPreCompileRelease
> Task :CordovaLib:writeReleaseAarMetadata
> Task :CordovaLib:generateReleaseRFile
> Task :app:checkReleaseAarMetadata

> Task :CordovaLib:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :app:desugarReleaseFileDependencies
> Task :CordovaLib:bundleLibCompileToJarRelease
> Task :CordovaLib:bundleLibRuntimeToDirRelease
> Task :app:processReleaseManifestForPackage
> Task :app:mergeReleaseShaders
> Task :app:compileReleaseShaders NO-SOURCE
> Task :app:generateReleaseAssets UP-TO-DATE
> Task :CordovaLib:mergeReleaseShaders
> Task :CordovaLib:compileReleaseShaders NO-SOURCE
> Task :CordovaLib:generateReleaseAssets UP-TO-DATE
> Task :CordovaLib:packageReleaseAssets
> Task :app:mergeReleaseAssets
> Task :app:processReleaseJavaRes NO-SOURCE
> Task :CordovaLib:processReleaseJavaRes
> Task :app:mergeReleaseJniLibFolders
> Task :CordovaLib:bundleLibResRelease
> Task :CordovaLib:mergeReleaseJniLibFolders
> Task :CordovaLib:mergeReleaseNativeLibs NO-SOURCE
> Task :CordovaLib:copyReleaseJniLibsProjectOnly
> Task :app:writeReleaseAppMetadata
> Task :app:mergeReleaseNativeLibs NO-SOURCE
> Task :app:stripReleaseDebugSymbols NO-SOURCE
> Task :CordovaLib:prepareReleaseArtProfile
> Task :app:mergeReleaseArtProfile
> Task :app:collectReleaseDependencies
> Task :app:configureReleaseDependencies
> Task :app:extractReleaseNativeSymbolTables NO-SOURCE
> Task :app:parseReleaseIntegrityConfig
> Task :app:mergeReleaseJavaResource
> Task :app:mergeExtDexRelease
> Task :app:processReleaseResources
> Task :app:compileReleaseJavaWithJavac
> Task :app:dexBuilderRelease
> Task :app:mergeDexRelease
> Task :app:buildReleasePreBundle
> Task :app:compileReleaseArtProfile
> Task :app:packageReleaseBundle
> Task :app:signReleaseBundle
> Task :app:produceReleaseBundleIdeListingFile
> Task :app:createReleaseBundleListingFileRedirect
> Task :app:bundleRelease

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.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 2m 5s
57 actionable tasks: 57 executed
Built the following bundle(s): 
	/app/platforms/android/app/build/outputs/bundle/release/app-release.aab
No scripts found for hook "after_compile".
No scripts found for hook "after_build".
cp: cannot stat 'platforms/android/app/build/outputs/apk/release/*.apk': No such file or directory

> echo Build failed with Node 20 and JDK 17: Command '['docker', 'run', '--rm', '-v', '/home/ubuntu/storage/cordova_assets/extracted/yanukadeneth99-Simple-Application-Cordova/Simple-Application-Cordova-389661b4a3e5969423b3712759596b6be19f055d:/source:ro', '-v', '/home/ubuntu/BachelorsThesis/scripts/cordova/output/yanukadeneth99-Simple-Application-Cordova:/output', '-v', '/home/ubuntu/.npm:/root/.npm', 'cordova-android:20-jdk17', 'bash', '-c', 'set -e\n            cp -r /source/. /app\n            cd /app\n            rm -rf platforms plugins node_modules || true\n            rm -rf $GRADLE_USER_HOME || true\n            mkdir -p $GRADLE_USER_HOME\n\n            # unset Gradle options\n            unset JAVA_OPTS\n\n            # install deps\n            if [ -f yarn.lock ]; then\n                yarn install --ignore-scripts\n            else\n                npm install --ignore-scripts\n            fi\n\n            # ensure android platform\n            cordova platform add android\n            cordova prepare android\n\n            # ---- PATCH ROOT GRADLE FILES (CRITICAL FIX) ----\n            for f in platforms/android/build.gradle platforms/android/CordovaLib/build.gradle; do\n                if [ -f "$f" ]; then\n                    sed -i \'/buildscript[[:space:]]*{/a\\\n                repositories {\\\n                    google()\\\n                    mavenCentral()\\\n                    maven { url "https://plugins.gradle.org/m2/" }\\\n                    maven { url "https://maven.aliyun.com/repository/public" }\\\n                    maven { url "https://jcenter.bintray.com/" }\\\n                    maven { url "https://jitpack.io" }\\\n                }\\\n            \' "$f" || true\n\n                    sed -i \'/allprojects[[:space:]]*{/a\\\n                repositories {\\\n                    google()\\\n                    mavenCentral()\\\n                    maven { url "https://plugins.gradle.org/m2/" }\\\n                    maven { url "https://maven.aliyun.com/repository/public" }\\\n                    maven { url "https://jcenter.bintray.com/" }\\\n                    maven { url "https://jitpack.io" }\\\n                }\\\n            \' "$f" || true\n                fi\n            done\n\n            # ---- FIX versioncompare (very common failure) ----\n            grep -RIl \'com.g00fy2:versioncompare:1.3.4\' platforms/android 2>/dev/null | \\\n            xargs -r sed -i \'s/com.g00fy2:versioncompare:1.3.4/io.github.g00fy2:versioncompare:1.5.0/g\' || true\n\n            # ---- fix versioncompare imports (CRITICAL) ----\n            find platforms/android \\( -name "*.gradle" -o -name "*.gradle.kts" \\) -print0 | \\\n            xargs -0 sed -i \'s/import com\\.g00fy2\\.versioncompare\\.Version/import io.github.g00fy2.versioncompare.Version/g\' || true\n\n            # ---- OPTIONAL: remove illegal JVM args ----\n            find platforms/android -type f -exec sed -i \'s/--illegal-access=permit//g\' {} + || true\n\n            # ---- JDK 8 specific patch ----\n            if [ \\"17\\" = "8" ]; then\n                find platforms/android -name "build.gradle" -exec \\\n                    sed -i \'s/compileSdkVersion [0-9]\\+/compileSdkVersion 30/g\' {} \\; || true\n\n                find platforms/android -name "build.gradle" -exec \\\n                    sed -i \'s/targetSdkVersion [0-9]\\+/targetSdkVersion 30/g\' {} \\; || true\n            fi\n\n            # ---- android sdk path ----\n            echo "sdk.dir=$ANDROID_HOME" > platforms/android/local.properties\n\n            # ---- force APK output (suppress AAB generation) ----\n            echo "android.bundle.enableAll=false" >> platforms/android/gradle.properties\n\n            # ---- enable ABI splits ----\n            if grep -q \'splits\' platforms/android/app/build.gradle 2>/dev/null; then\n                sed -i \'s/enable false/enable true/\' platforms/android/app/build.gradle || true\n            else\n                sed -i \'/^android[[:space:]]*{/a\\    splits {\\n        abi {\\n            reset()\\n            enable true\\n            universalApk false\\n            include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"\\n        }\\n    }\' platforms/android/app/build.gradle || true\n            fi\n\n            # ---- enable R8 / minification ----\n            sed -i \'s/minifyEnabled false/minifyEnabled true/\' platforms/android/app/build.gradle || true\n\n            # ---- sign release with debug key ----\n            sed -i \'/buildTypes/,/}/s/release {/release {\\n            signingConfig signingConfigs.debug/\' platforms/android/app/build.gradle || true\n\n            # ---- build release APK ----\n            cordova build android --release --no-interactive --verbose\n\n            cp platforms/android/app/build/outputs/apk/release/*.apk /output/r8/\n\n            # ---- copy TPL metadata ----\n            [ -f config.xml ] && cp config.xml /output/r8/ || true\n            [ -f plugins/fetch.json ] && cp plugins/fetch.json /output/r8/ || true\n            [ -f plugins/android.json ] && cp plugins/android.json /output/r8/ || true\n            [ -f platforms/android/app/build.gradle ] && cp platforms/android/app/build.gradle /output/r8/app-build.gradle || true\n            [ -f platforms/android/build.gradle ] && cp platforms/android/build.gradle /output/r8/root-build.gradle || true\n            [ -f platforms/android/settings.gradle ] && cp platforms/android/settings.gradle /output/r8/ || true\n            [ -f package.json ] && cp package.json /output/r8/ || true\n            [ -f package-lock.json ] && cp package-lock.json /output/r8/ || true\n            [ -f yarn.lock ] && cp yarn.lock /output/r8/ || true\n            [ -f pnpm-lock.yaml ] && cp pnpm-lock.yaml /output/r8/ || true\n            mkdir -p /output/r8/plugin_manifests\n            find plugins -name "plugin.xml" 2>/dev/null | while read f; do cp "$f" /output/r8/plugin_manifests/$(echo "$f" | tr \'/\' \'_\') 2>/dev/null; done || true\n            find plugins -name "*.gradle" 2>/dev/null | while read f; do cp "$f" /output/r8/ 2>/dev/null; done || true\n            find platforms/android -name "*.gradle" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/ 2>/dev/null; done || true\n            mkdir -p /output/r8/libs\n            find plugins platforms/android -name "*.jar" -not -name "gradle-wrapper.jar" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/libs/ 2>/dev/null; done || true\n            find plugins platforms/android -name "*.aar" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/libs/ 2>/dev/null; done || true\n            find plugins platforms/android -name "*.so" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/libs/ 2>/dev/null; done || true\n            ']' returned non-zero exit status 1.
Build failed with Node 20 and JDK 17: Command '['docker', 'run', '--rm', '-v', '/home/ubuntu/storage/cordova_assets/extracted/yanukadeneth99-Simple-Application-Cordova/Simple-Application-Cordova-389661b4a3e5969423b3712759596b6be19f055d:/source:ro', '-v', '/home/ubuntu/BachelorsThesis/scripts/cordova/output/yanukadeneth99-Simple-Application-Cordova:/output', '-v', '/home/ubuntu/.npm:/root/.npm', 'cordova-android:20-jdk17', 'bash', '-c', 'set -e\n            cp -r /source/. /app\n            cd /app\n            rm -rf platforms plugins node_modules || true\n            rm -rf $GRADLE_USER_HOME || true\n            mkdir -p $GRADLE_USER_HOME\n\n            # unset Gradle options\n            unset JAVA_OPTS\n\n            # install deps\n            if [ -f yarn.lock ]; then\n                yarn install --ignore-scripts\n            else\n                npm install --ignore-scripts\n            fi\n\n            # ensure android platform\n            cordova platform add android\n            cordova prepare android\n\n            # ---- PATCH ROOT GRADLE FILES (CRITICAL FIX) ----\n            for f in platforms/android/build.gradle platforms/android/CordovaLib/build.gradle; do\n                if [ -f "$f" ]; then\n                    sed -i \'/buildscript[[:space:]]*{/a\\\n                repositories {\\\n                    google()\\\n                    mavenCentral()\\\n                    maven { url "https://plugins.gradle.org/m2/" }\\\n                    maven { url "https://maven.aliyun.com/repository/public" }\\\n                    maven { url "https://jcenter.bintray.com/" }\\\n                    maven { url "https://jitpack.io" }\\\n                }\\\n            \' "$f" || true\n\n                    sed -i \'/allprojects[[:space:]]*{/a\\\n                repositories {\\\n                    google()\\\n                    mavenCentral()\\\n                    maven { url "https://plugins.gradle.org/m2/" }\\\n                    maven { url "https://maven.aliyun.com/repository/public" }\\\n                    maven { url "https://jcenter.bintray.com/" }\\\n                    maven { url "https://jitpack.io" }\\\n                }\\\n            \' "$f" || true\n                fi\n            done\n\n            # ---- FIX versioncompare (very common failure) ----\n            grep -RIl \'com.g00fy2:versioncompare:1.3.4\' platforms/android 2>/dev/null | \\\n            xargs -r sed -i \'s/com.g00fy2:versioncompare:1.3.4/io.github.g00fy2:versioncompare:1.5.0/g\' || true\n\n            # ---- fix versioncompare imports (CRITICAL) ----\n            find platforms/android \\( -name "*.gradle" -o -name "*.gradle.kts" \\) -print0 | \\\n            xargs -0 sed -i \'s/import com\\.g00fy2\\.versioncompare\\.Version/import io.github.g00fy2.versioncompare.Version/g\' || true\n\n            # ---- OPTIONAL: remove illegal JVM args ----\n            find platforms/android -type f -exec sed -i \'s/--illegal-access=permit//g\' {} + || true\n\n            # ---- JDK 8 specific patch ----\n            if [ \\"17\\" = "8" ]; then\n                find platforms/android -name "build.gradle" -exec \\\n                    sed -i \'s/compileSdkVersion [0-9]\\+/compileSdkVersion 30/g\' {} \\; || true\n\n                find platforms/android -name "build.gradle" -exec \\\n                    sed -i \'s/targetSdkVersion [0-9]\\+/targetSdkVersion 30/g\' {} \\; || true\n            fi\n\n            # ---- android sdk path ----\n            echo "sdk.dir=$ANDROID_HOME" > platforms/android/local.properties\n\n            # ---- force APK output (suppress AAB generation) ----\n            echo "android.bundle.enableAll=false" >> platforms/android/gradle.properties\n\n            # ---- enable ABI splits ----\n            if grep -q \'splits\' platforms/android/app/build.gradle 2>/dev/null; then\n                sed -i \'s/enable false/enable true/\' platforms/android/app/build.gradle || true\n            else\n                sed -i \'/^android[[:space:]]*{/a\\    splits {\\n        abi {\\n            reset()\\n            enable true\\n            universalApk false\\n            include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"\\n        }\\n    }\' platforms/android/app/build.gradle || true\n            fi\n\n            # ---- enable R8 / minification ----\n            sed -i \'s/minifyEnabled false/minifyEnabled true/\' platforms/android/app/build.gradle || true\n\n            # ---- sign release with debug key ----\n            sed -i \'/buildTypes/,/}/s/release {/release {\\n            signingConfig signingConfigs.debug/\' platforms/android/app/build.gradle || true\n\n            # ---- build release APK ----\n            cordova build android --release --no-interactive --verbose\n\n            cp platforms/android/app/build/outputs/apk/release/*.apk /output/r8/\n\n            # ---- copy TPL metadata ----\n            [ -f config.xml ] && cp config.xml /output/r8/ || true\n            [ -f plugins/fetch.json ] && cp plugins/fetch.json /output/r8/ || true\n            [ -f plugins/android.json ] && cp plugins/android.json /output/r8/ || true\n            [ -f platforms/android/app/build.gradle ] && cp platforms/android/app/build.gradle /output/r8/app-build.gradle || true\n            [ -f platforms/android/build.gradle ] && cp platforms/android/build.gradle /output/r8/root-build.gradle || true\n            [ -f platforms/android/settings.gradle ] && cp platforms/android/settings.gradle /output/r8/ || true\n            [ -f package.json ] && cp package.json /output/r8/ || true\n            [ -f package-lock.json ] && cp package-lock.json /output/r8/ || true\n            [ -f yarn.lock ] && cp yarn.lock /output/r8/ || true\n            [ -f pnpm-lock.yaml ] && cp pnpm-lock.yaml /output/r8/ || true\n            mkdir -p /output/r8/plugin_manifests\n            find plugins -name "plugin.xml" 2>/dev/null | while read f; do cp "$f" /output/r8/plugin_manifests/$(echo "$f" | tr \'/\' \'_\') 2>/dev/null; done || true\n            find plugins -name "*.gradle" 2>/dev/null | while read f; do cp "$f" /output/r8/ 2>/dev/null; done || true\n            find platforms/android -name "*.gradle" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/ 2>/dev/null; done || true\n            mkdir -p /output/r8/libs\n            find plugins platforms/android -name "*.jar" -not -name "gradle-wrapper.jar" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/libs/ 2>/dev/null; done || true\n            find plugins platforms/android -name "*.aar" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/libs/ 2>/dev/null; done || true\n            find plugins platforms/android -name "*.so" 2>/dev/null | grep -v "/build/" | while read f; do cp "$f" /output/r8/libs/ 2>/dev/null; done || true\n            ']' returned non-zero exit status 1.
