Anywhere container build fails during cordova build android command

 Anywhere container build fails due to below error

BUILD FAILED in 2m 39s

    at ChildProcess.exithandler (child_process.js:303:12)

    at ChildProcess.emit (events.js:315:20)

    at maybeClose (internal/child_process.js:1051:16)

    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {

  killed: false,

  code: 1,

  signal: null,

  cmd: 'M:\\IBM\\Anywhere\\MaximoAnywhereAppCntr\\node_modules\\cordova\\bin\\cordova build android'

}

  [ERROR]  2023-2-17 19:33:29   [IncidentReport::android]  Command failed: M:\IBM\Anywhere\MaximoAnywhereAppCntr\node_modules\cordova\bin\cordova build android

Note: M:\IBM\Anywhere\MaximoAnywhereAppCntr\output\IncidentReport\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


FAILURE: Build failed with an exception.

Turns out it was caused by the command cordova build android command throwing the below error

cordova-plugin-androidx-adapter: EXCEPTION: Failed to load dependencies: Error: Cannot find module 'recursive-readdir'

recursive-readdir was missing in NPM. 

Below Command seems to have fixed the issue.

M:\IBM\Anywhere\MaximoAnywhereAppCntr>npm i recursive-readdir --nosave 

Other Reasons for cordova build android error

  • Check the Container.properties and make sure android version is atleast android-30 for maximo 7.6.4. ifix004

## Specifies the Android SDK target for building Android applications
Android_TARGET_DEVICE_NAME=android-30
  • Rename d8.bat to dx.bat if you get below error 
    • "build-tool 31.0.0 is missing dx" 
    • https://stackoverflow.com/a/68430992
  • Make sure correct SDK is installed

Comments

Popular posts from this blog

BMXAA6713E - The record could not be retrieved from the database. Error

Rebuilding Maximo Text Indexes due to Query performance issues

List of things checked by Maximo Integrity checker