
> echo Attempting build for rn0x-watermark-app with Node 20 and JDK 17
Attempting build for rn0x-watermark-app with Node 20 and JDK 17

> docker run --rm -v /home/ubuntu/storage/cordova_assets/extracted/rn0x-watermark-app/watermark-app-471f55de83a345673b89dda1dfc98bdbf707464a:/source:ro -v /home/ubuntu/BachelorsThesis/scripts/cordova/output/rn0x-watermark-app:/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 inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm warn deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm warn deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm warn deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm warn deprecated npmlog@5.0.1: This package is no longer supported.
npm warn deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm warn deprecated whatwg-encoding@2.0.0: Use @exodus/bytes instead for a more spec-conformant and faster implementation
npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated whatwg-encoding@1.0.5: Use @exodus/bytes instead for a more spec-conformant and faster implementation
npm warn deprecated @babel/plugin-proposal-private-property-in-object@7.21.11: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.
npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported.
npm warn deprecated glob@7.2.3: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated domexception@2.0.1: Use your platform's native DOMException instead
npm warn deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
npm warn deprecated q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.
npm warn deprecated
npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
npm warn deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm warn deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated gauge@3.0.2: This package is no longer supported.
npm warn deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
npm warn deprecated workbox-google-analytics@6.6.0: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
npm warn deprecated tar@6.2.1: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
npm warn deprecated uuid@8.3.2: uuid@10 and below is no longer supported.  For ESM codebases, update to uuid@latest.  For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).
npm warn deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1608 packages, and audited 1609 packages in 1m

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

32 vulnerabilities (9 low, 5 moderate, 17 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@^13.0.0
Adding android project...
Creating Cordova project for the Android platform:
	Path: platforms/android
	Package: org.i8xnet.watermark
	Name: Watermark
	Activity: MainActivity
	Android Target SDK: android-34
	Android Compile SDK: 34
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@13.0.0
Discovered plugin "cordova-plugin-camera". Adding it to the project
Installing "cordova-plugin-camera" for android
Subproject Path: CordovaLib
Subproject Path: app
Adding cordova-plugin-camera to package.json
Discovered plugin "cordova-plugin-file". Adding it to the project
Installing "cordova-plugin-file" for android
Subproject Path: CordovaLib
Subproject Path: app

The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.

If this is a new application no changes are required.

If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:

      "<preference name="AndroidPersistentFileLocation" value="Compatibility" />"

to config.xml in order for the application to find previously stored files.
        
Adding cordova-plugin-file to package.json
Discovered plugin "cordova-plugin-file-transfer". Adding it to the project
Installing "cordova-plugin-file-transfer" for android
Plugin dependency "cordova-plugin-file@8.1.3" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Adding cordova-plugin-file-transfer to package.json
Discovered plugin "cordova-plugin-statusbar". Adding it to the project
Installing "cordova-plugin-statusbar" for android
Adding cordova-plugin-statusbar to package.json
Discovered plugin "cordova-plugin-inappbrowser". Adding it to the project
Installing "cordova-plugin-inappbrowser" for android
Adding cordova-plugin-inappbrowser to package.json
Discovered plugin "cordova-plugin-device". Adding it to the project
Installing "cordova-plugin-device" for android
Adding cordova-plugin-device to package.json
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)
  copy  platforms/android/platform_www/cordova_plugins.js platforms/android/app/src/main/assets/www/cordova_plugins.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-camera/www/Camera.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/Camera.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraConstants.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-device/www/device.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-device/www/device.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file-transfer/www/FileTransferError.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransferError.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/DirectoryEntry.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryReader.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/DirectoryReader.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/Entry.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/Entry.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/File.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/File.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileEntry.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileEntry.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileError.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileError.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileReader.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileReader.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileSystem.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileSystem.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadOptions.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileUploadOptions.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadResult.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileUploadResult.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileWriter.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileWriter.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/Flags.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/Flags.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/LocalFileSystem.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/LocalFileSystem.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/Metadata.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/Metadata.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/ProgressEvent.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/ProgressEvent.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/android/Entry.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/android/Entry.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/android/FileSystem.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/android/FileSystem.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/browser/isChrome.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/browser/isChrome.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystemPaths.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/fileSystemPaths.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems-roots.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/fileSystems-roots.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/fileSystems.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/requestFileSystem.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/requestFileSystem.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-statusbar/www/statusbar.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-statusbar/www/statusbar.js (updated file)
Wrote out android application name "Watermark" to /app/platforms/android/app/src/main/res/values/strings.xml
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 org.i8xnet.watermark
[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
Updating icons at platforms/android/app/src/main/res
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
Using Gradle: 8.4

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

> Task :wrapper

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

Welcome to Gradle 8.4!

Here are the highlights of this release:
 - Compiling and testing with Java 21
 - Faster Java compilation on Windows
 - Role focused dependency configurations creation

For more details see https://docs.gradle.org/8.4/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.4/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
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 :app:generateDebugBuildConfig
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :app:javaPreCompileDebug
> Task :app:generateDebugResValues
> Task :CordovaLib:generateDebugResValues
> Task :CordovaLib:generateDebugResources
> Task :CordovaLib:writeDebugAarMetadata
> Task :CordovaLib:packageDebugResources
> Task :app:checkDebugAarMetadata
> Task :app:mapDebugSourceSetPaths
> Task :app:generateDebugResources
> Task :app:packageDebugResources
> Task :app:mergeDebugResources
> Task :app:createDebugCompatibleScreenManifests
> Task :app:parseDebugLocalResources
> Task :app:extractDeepLinksDebug
> Task :CordovaLib:extractDeepLinksDebug
> Task :CordovaLib:processDebugManifest
> Task :CordovaLib:compileDebugLibraryResources
> Task :app:processDebugMainManifest
> Task :app:processDebugManifest
> Task :CordovaLib:javaPreCompileDebug
> Task :CordovaLib:parseDebugLocalResources
> Task :app:mergeDebugShaders
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:generateDebugRFile
> Task :CordovaLib:mergeDebugShaders

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

> Task :CordovaLib:compileDebugShaders NO-SOURCE
> Task :CordovaLib:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:packageDebugAssets
> Task :CordovaLib:bundleLibCompileToJarDebug
> Task :app:mergeDebugAssets
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:compressDebugAssets
> Task :CordovaLib:processDebugJavaRes
> Task :app:desugarDebugFileDependencies
> Task :app:checkDebugDuplicateClasses
> Task :CordovaLib:bundleLibRuntimeToJarDebug
> Task :app:mergeDebugJniLibFolders
> Task :CordovaLib:bundleLibRuntimeToDirDebug
> Task :app:mergeDebugJavaResource
> Task :app:processDebugManifestForPackage
> Task :CordovaLib:mergeDebugJniLibFolders
> Task :CordovaLib:mergeDebugNativeLibs NO-SOURCE
> Task :CordovaLib:copyDebugJniLibsProjectOnly
> Task :app:mergeLibDexDebug
> Task :app:validateSigningDebug
> Task :app:mergeDebugNativeLibs NO-SOURCE
> Task :app:stripDebugDebugSymbols NO-SOURCE
> Task :app:writeDebugAppMetadata
> Task :app:writeDebugSigningConfigVersions
> Task :app:mergeExtDexDebug
> Task :app:processDebugResources

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

> Task :app:dexBuilderDebug
> Task :app:mergeProjectDexDebug
> 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 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.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 1m 48s
49 actionable tasks: 49 executed
Built the following apk(s): 
	/app/platforms/android/app/build/outputs/apk/debug/app-arm64-v8a-debug.apk
	/app/platforms/android/app/build/outputs/apk/debug/app-x86-debug.apk
	/app/platforms/android/app/build/outputs/apk/debug/app-armeabi-v7a-debug.apk
	/app/platforms/android/app/build/outputs/apk/debug/app-x86_64-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/rn0x-watermark-app/watermark-app-471f55de83a345673b89dda1dfc98bdbf707464a:/source:ro -v /home/ubuntu/BachelorsThesis/scripts/cordova/output/rn0x-watermark-app:/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 inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm warn deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm warn deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm warn deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm warn deprecated npmlog@5.0.1: This package is no longer supported.
npm warn deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated whatwg-encoding@2.0.0: Use @exodus/bytes instead for a more spec-conformant and faster implementation
npm warn deprecated whatwg-encoding@1.0.5: Use @exodus/bytes instead for a more spec-conformant and faster implementation
npm warn deprecated @babel/plugin-proposal-private-property-in-object@7.21.11: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.
npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported.
npm warn deprecated glob@7.2.3: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated domexception@2.0.1: Use your platform's native DOMException instead
npm warn deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
npm warn deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm warn deprecated q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.
npm warn deprecated
npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
npm warn deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated gauge@3.0.2: This package is no longer supported.
npm warn deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
npm warn deprecated workbox-google-analytics@6.6.0: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
npm warn deprecated tar@6.2.1: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
npm warn deprecated uuid@8.3.2: uuid@10 and below is no longer supported.  For ESM codebases, update to uuid@latest.  For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).
npm warn deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1608 packages, and audited 1609 packages in 51s

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

32 vulnerabilities (9 low, 5 moderate, 17 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@^13.0.0
Adding android project...
Creating Cordova project for the Android platform:
	Path: platforms/android
	Package: org.i8xnet.watermark
	Name: Watermark
	Activity: MainActivity
	Android Target SDK: android-34
	Android Compile SDK: 34
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@13.0.0
Discovered plugin "cordova-plugin-camera". Adding it to the project
Installing "cordova-plugin-camera" for android
Subproject Path: CordovaLib
Subproject Path: app
Adding cordova-plugin-camera to package.json
Discovered plugin "cordova-plugin-file". Adding it to the project
Installing "cordova-plugin-file" for android
Subproject Path: CordovaLib
Subproject Path: app

The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.

If this is a new application no changes are required.

If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:

      "<preference name="AndroidPersistentFileLocation" value="Compatibility" />"

to config.xml in order for the application to find previously stored files.
        
Adding cordova-plugin-file to package.json
Discovered plugin "cordova-plugin-file-transfer". Adding it to the project
Installing "cordova-plugin-file-transfer" for android
Plugin dependency "cordova-plugin-file@8.1.3" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Adding cordova-plugin-file-transfer to package.json
Discovered plugin "cordova-plugin-statusbar". Adding it to the project
Installing "cordova-plugin-statusbar" for android
Adding cordova-plugin-statusbar to package.json
Discovered plugin "cordova-plugin-inappbrowser". Adding it to the project
Installing "cordova-plugin-inappbrowser" for android
Adding cordova-plugin-inappbrowser to package.json
Discovered plugin "cordova-plugin-device". Adding it to the project
Installing "cordova-plugin-device" for android
Adding cordova-plugin-device to package.json
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)
  copy  platforms/android/platform_www/cordova_plugins.js platforms/android/app/src/main/assets/www/cordova_plugins.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-camera/www/Camera.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/Camera.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraConstants.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-device/www/device.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-device/www/device.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file-transfer/www/FileTransferError.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransferError.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/DirectoryEntry.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryReader.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/DirectoryReader.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/Entry.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/Entry.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/File.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/File.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileEntry.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileEntry.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileError.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileError.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileReader.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileReader.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileSystem.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileSystem.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadOptions.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileUploadOptions.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadResult.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileUploadResult.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/FileWriter.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/FileWriter.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/Flags.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/Flags.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/LocalFileSystem.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/LocalFileSystem.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/Metadata.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/Metadata.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/ProgressEvent.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/ProgressEvent.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/android/Entry.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/android/Entry.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/android/FileSystem.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/android/FileSystem.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/browser/isChrome.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/browser/isChrome.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystemPaths.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/fileSystemPaths.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems-roots.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/fileSystems-roots.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/fileSystems.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/requestFileSystem.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/requestFileSystem.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js (updated file)
  copy  platforms/android/platform_www/plugins/cordova-plugin-statusbar/www/statusbar.js platforms/android/app/src/main/assets/www/plugins/cordova-plugin-statusbar/www/statusbar.js (updated file)
Wrote out android application name "Watermark" to /app/platforms/android/app/src/main/res/values/strings.xml
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 org.i8xnet.watermark
[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
Updating icons at platforms/android/app/src/main/res
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
Using Gradle: 8.4

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

> Task :wrapper

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

Welcome to Gradle 8.4!

Here are the highlights of this release:
 - Compiling and testing with Java 21
 - Faster Java compilation on Windows
 - Role focused dependency configurations creation

For more details see https://docs.gradle.org/8.4/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.4/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build 
> Task :app:preBuild UP-TO-DATE
> Task :app:preReleaseBuild UP-TO-DATE
> Task :app:generateReleaseResValues
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preReleaseBuild UP-TO-DATE
> 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 :CordovaLib:processReleaseManifest
> Task :app:mergeReleaseResources
> Task :CordovaLib:parseReleaseLocalResources
> Task :app:processReleaseMainManifest
> Task :app:processReleaseManifest
> Task :app:processApplicationManifestReleaseForBundle
> Task :CordovaLib:javaPreCompileRelease
> Task :app:bundleReleaseResources
> Task :CordovaLib:generateReleaseRFile
> Task :app:checkReleaseDuplicateClasses

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

> Task :app:generateReleaseBuildConfig
> Task :app:javaPreCompileRelease
> Task :CordovaLib:writeReleaseAarMetadata
> Task :app:packageReleaseResources
> Task :CordovaLib:bundleLibRuntimeToDirRelease
> Task :app:checkReleaseAarMetadata
> Task :app:desugarReleaseFileDependencies
> Task :CordovaLib:bundleLibCompileToJarRelease
> Task :app:parseReleaseLocalResources
> Task :CordovaLib:bundleLibRuntimeToJarRelease
> 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:mergeReleaseJniLibFolders
> Task :CordovaLib:mergeReleaseNativeLibs NO-SOURCE
> Task :app:writeReleaseAppMetadata
> Task :CordovaLib:prepareReleaseArtProfile
> Task :CordovaLib:copyReleaseJniLibsProjectOnly
> Task :app:mergeReleaseArtProfile
> Task :app:mergeReleaseNativeLibs NO-SOURCE
> Task :app:stripReleaseDebugSymbols NO-SOURCE
> Task :app:collectReleaseDependencies
> Task :app:configureReleaseDependencies
> Task :app:extractReleaseNativeSymbolTables NO-SOURCE
> Task :app:parseReleaseIntegrityConfig
> Task :app:processReleaseManifestForPackage
> Task :app:mergeReleaseJavaResource
> Task :app:mergeExtDexRelease
> Task :app:processReleaseResources

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

> Task :app:dexBuilderRelease
> Task :app:mergeReleaseGlobalSynthetics
> 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 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.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 1m 42s
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/rn0x-watermark-app/watermark-app-471f55de83a345673b89dda1dfc98bdbf707464a:/source:ro', '-v', '/home/ubuntu/BachelorsThesis/scripts/cordova/output/rn0x-watermark-app:/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/rn0x-watermark-app/watermark-app-471f55de83a345673b89dda1dfc98bdbf707464a:/source:ro', '-v', '/home/ubuntu/BachelorsThesis/scripts/cordova/output/rn0x-watermark-app:/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.
