apache / cordova-android

Apache Cordova Android
https://cordova.apache.org/
Apache License 2.0
3.59k stars 1.52k forks source link

Cordova android 11.0.0 build release failed Execution failed for task ':app:packageReleaseBundle' -> can't build .aab file #1569

Closed stephwildcode closed 2 months ago

stephwildcode commented 1 year ago

Bug Report

Problem

What is expected to happen?

an aab file will be build

What does actually happen?

When I ran : cordova build android --release

Subproject Path: CordovaLib Subproject Path: app

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:compileReleaseJavaWithJavac Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.

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:packageReleaseBundle FAILED

FAILURE: Build failed with an exception.

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

BUILD FAILED in 35s 55 actionable tasks: 51 executed, 4 up-to-date

Information

Command or Code

cordova build android --debug -> it's working .apk build successfully cordova build android --release -> it's not working. Can't build .aab file cordova build android --release -- --packageType=apk -> it's working .apk build successfully

Environment, Platform, Device

cordova 11.0.0 JDK 11.0.18 android sdk 32 gradle 7.6.1

Version information

cordova 11.0.0 JDK 11.0.18 android sdk 32 gradle 7.6.1

"devDependencies": { "@angular-devkit/build-angular": "14.2.10", "@angular-eslint/builder": "14.4.0", "@angular-eslint/eslint-plugin": "14.4.0", "@angular-eslint/eslint-plugin-template": "14.4.0", "@angular-eslint/schematics": "14.4.0", "@angular-eslint/template-parser": "14.4.0", "@angular/compiler-cli": "14.2.12", "@angular/language-service": "14.2.12", "@types/file-saver": "2.0.5", "@types/jasminewd2": "2.0.10", "@types/jest": "28.1.6", "@types/mocha": "9.1.1", "@types/node": "18.6.1", "@typescript-eslint/eslint-plugin": "5.37.0", "@typescript-eslint/eslint-plugin-tslint": "5.39.0", "@typescript-eslint/parser": "5.37.0", "camelcase-keys-deep": "0.1.0", "codelyzer": "6.0.2", "cordova-android": "11.0.0", "cordova-browser": "6.0.0", "cordova-plugin-add-swift-support": "2.0.2", "cordova-plugin-app-version": "0.1.14", "cordova-plugin-camera": "6.0.0", "cordova-plugin-device": "2.1.0", "cordova-plugin-device-name": "1.3.5", "cordova-plugin-dialogs": "2.0.2", "cordova-plugin-exit": "1.0.3", "cordova-plugin-file": "7.0.0", "cordova-plugin-logtofile": "1.1.2", "cordova-plugin-media": "6.0.0", "cordova-plugin-media-capture": "4.0.0", "cordova-plugin-network-information": "3.0.0", "cordova-plugin-networkinterface": "2.2.0", "cordova-plugin-screen-orientation": "3.0.2", "cordova-plugin-vibration": "3.1.1", "cordova-plugin-wifiinfo": "0.1.0", "cordova-plugin-wifiwizard2": "3.1.1", "cordova-zip-plugin": "2.0.0", "cordova.plugins.diagnostic": "6.1.1", "cross-env": "7.0.3", "es6-promise-plugin": "4.2.2", "eslint": "8.24.0", "eslint-config-prettier": "8.5.0", "eslint-plugin-import": "2.26.0", "jasmine-core": "4.3.0", "jasmine-spec-reporter": "7.0.0", "karma": "6.4.0", "karma-chrome-launcher": "3.1.1", "karma-coverage-istanbul-reporter": "3.0.3", "karma-jasmine": "5.1.0", "karma-jasmine-html-reporter": "2.0.0", "ng2-pdf-viewer": "9.1.3", "prettier": "2.7.1", "protractor": "7.0.0", "schematics-scss-migrate": "1.3.15", "ts-node": "10.9.1", "wifiwizard2": "^3.1.1", "xmldom": "0.6.0" }, "cordova": { "platforms": [ "android" ], "plugins": { "cordova-plugin-camera": { "ANDROIDX_CORE_VERSION": "1.6.+" }, "cordova-plugin-device": {}, "cordova-plugin-media-capture": {}, "cordova-plugin-vibration": {}, "cordova-plugin-media": {}, "cordova-plugin-file": { "ANDROIDX_WEBKIT_VERSION": "1.4.0" }, "cordova-plugin-logtofile": {}, "cordova-plugin-dialogs": {}, "cordova-plugin-network-information": {}, "cordova-plugin-screen-orientation": {}, "cordova-plugin-exit": {}, "cordova-plugin-wifiinfo": {}, "cordova.plugins.diagnostic": { "ANDROIDX_VERSION": "1.0.0", "ANDROIDX_APPCOMPAT_VERSION": "1.3.1" }, "cordova-plugin-device-name": {}, "cordova-plugin-add-swift-support": {}, "es6-promise-plugin": {}, "com.jjdltc.cordova.plugin.zip": {}, "cordova-plugin-app-version": {}, "wifiwizard2": {}, "cordova-plugin-networkinterface": {} } }, "dependencies": { "@angular/animations": "14.2.12", "@angular/cdk": "14.2.7", "@angular/cli": "14.2.10", "@angular/common": "14.2.12", "@angular/compiler": "14.2.12", "@angular/core": "14.2.12", "@angular/flex-layout": "14.0.0-beta.41", "@angular/forms": "14.2.12", "@angular/material": "14.2.7", "@angular/platform-browser": "14.2.12", "@angular/platform-browser-dynamic": "14.2.12", "@angular/router": "14.2.12", "@types/socketcluster-client": "16.0.0", "core-js": "3.24.0", "date-fns": "2.29.3", "execa": "5.1.1", "file-saver": "2.0.5", "lodash": "4.17.21", "material-design-icons-iconfont": "6.7.0", "pouchdb": "7.3.0", "pouchdb-find": "7.3.0", "rxjs": "7.5.6", "socketcluster-client": "16.1.1", "typescript": "4.7.4", "zone.js": "0.11.7" }

Checklist

breautek commented 1 year ago

I'm unable to reproduce your issue.

I started with an empty android project and incrementally added each one of your plugins and rebuilt a release AAB of a test project and each seems to builds an AAB as expected.

I also couldn't test with cordova-plugin-logtofile as that produced build errors that seems to be unrelated to your issue. I assume it requires additional configuration.

I then compared and ensure my installed plugins matches your plugins based on your dependencies, which also failed to reproduce the issue.

Are you able to reproduce your issue with a sample project? If so you can share a minimal reproduction app that I can take another look at.

stephwildcode commented 1 year ago

Hello,

Thanks for your reply.

To build with cordova-plugin-logtofile, you need to edit this files :

replace "compile" by "implementation" : \platforms\android\cordova-plugin-logtofile\applicationtablette-logtofile.gradle

Edit the file .\platforms\android\app\build.gradle and add packagingOptions under android

  android {
  packagingOptions {
  exclude 'AndroidManifest.xml'
  exclude 'resources.arsc'
  }
  ....
  }

I tried to build an aab with an empty project without plugins and it's working.

I'll try to build an aab with an empty project with plugins soon.

jcesarmobile commented 2 months ago

closing since the reporter didn't provide a sample app and couldn't reproduce with an empty app, so seems a bug in one of the plugins.