Custom Plugin for Android: java.lang.NullPointerException

I´m developing this Android application to run on device. I´m using Ionic and Angular to develop the application.

Now I need to create a custom plugin using Plugman. This plugin should allowed user to authentication using IBM APP ID.

I followed the instructions mention here GitHub - ibm-cloud-security/appid-clientsdk-android: Android SDK for the Bluemix AppID service to create my gradle file.

However, when I run ionic cordova run android --verbose --debug I get this error

  • What went wrong: Execution failed for task :app:processDebugManifest.

java.lang.NullPointerException (no error message)

And I have no clue what could be the root cause. This is my first time I develop a custom plugin. My suspicious relies on the dependency, but I can not tell what part is causing the issue.

Ionic Framework : @ionic/angular 5.0.7
@angular-devkit/build-angular : 0.803.26
@angular-devkit/schematics : 8.3.26
@angular/cli : 8.3.26
@ionic/angular-toolkit : 2.2.0

Cordova:

Cordova CLI : 10.0.0
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 7 other plugins)

Utility:

cordova-res (update available: 0.14.0) : 0.10.0
native-run (update available: 1.0.0) : 0.3.0

System:

Android SDK Tools : 26.1.1 (C:\\Android\\sdk)
Ionic Framework : @ionic/angular 5.0.7
@angular-devkit/build-angular : 0.803.26
@angular-devkit/schematics : 8.3.26
@angular/cli : 8.3.26
@ionic/angular-toolkit : 2.2.0

Cordova:

Cordova CLI : 10.0.0
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 7 other plugins)

Utility:

cordova-res (update available: 0.14.0) : 0.10.0
native-run (update available: 1.0.0) : 0.3.0

System:

Android SDK Tools : 26.1.1 (C:\\Android\\sdk)
NodeJS : v14.2.0 (C:\Program Files\\nodejs\\node.exe)
npm : 6.14.4
OS : Windows 10```

LOG=======================================
C:\project_cren\plugin\ci-uix-mobile-master>ionic cordova run android --verbose --debug
  ionic:lib Terminal info: { ci: false, shell: 'C:\\WINDOWS\\system32\\cmd.exe', tty: false, windows: true } +0ms
  ionic:lib CLI global options: { _: [ 'cordova', 'run', 'android' ], help: null, h: null, verbose: true, quiet: null, interactive: false, color: true, confirm: null, json: null, debug: true, project: null, '--': [] } +4ms
  ionic:lib:project Project type from config: @ionic/angular (angular) +0ms
  ionic:lib:project Project details: { configPath: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\ionic.config.json', errors: [], context: 'app', type: 'angular' } +1ms
  ionic Context: { binPath: 'C:\\Users\\AMANDODOSSANTOSNETO\\AppData\\Roaming\\npm\\node_modules\\@ionic\\cli\\bin\\ionic', libPath: 'C:\\Users\\AMANDODOSSANTOSNETO\\AppData\\Roaming\\npm\\node_modules\\@ionic\\cli', execPath: 'C:\\project_cren\\plugin\\ci-uix-mobile-master', version: '6.7.0' } +0ms
  ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\config.xml', package.json: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\package.json') +0ms
  ionic:commands:run Native platform devices: [] +0ms
  ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\config.xml', package.json: 'C:\\project_cren\\plugin\\ci-uix-mobile-master\\package.json') +11s
  ionic:lib:build build options: {
  ionic:lib:build   '--': [],
  ionic:lib:build   engine: 'cordova',
  ionic:lib:build   platform: 'android',
  ionic:lib:build   project: 'app',
  ionic:lib:build   verbose: false,
  ionic:lib:build   configuration: undefined,
  ionic:lib:build   sourcemaps: undefined,
  ionic:lib:build   cordovaAssets: true,
  ionic:lib:build   watch: undefined,
  ionic:lib:build   type: 'angular'
  ionic:lib:build } +0ms
  ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
  ionic:lib:build Looking for ionic:build npm script. +154ms
  ng:analytics getGlobalAnalytics +0ms
  ng:analytics Client Analytics config found: false +47ms
  ng:analytics Analytics disabled. Ignoring all analytics. +1ms
  ng:analytics getSharedAnalytics +0ms
  
  
  
  
  WARNING in ./src/app/invoice-detail/invoice-detail.component.scss
Module Warning (from ./node_modules/postcss-loader/src/index.js):
Warning

(4:3) start value has mixed support, consider using flex-start instead
 @ ./src/app/invoice-detail/invoice-detail.component.ts 27:41-83
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi ./src/main.ts
  ionic:lib:hooks Looking for ionic:build:after npm script. +40s

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> java.lang.NullPointerException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 13s
C:\project_cren\plugin\ci-uix-mobile-master\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> java.lang.NullPointerException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 13s
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd build android --debug --verbose exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.
  ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
  ionic:utils-process onBeforeExit handler: running 2 functions +1ms
  ionic:utils-process error while killing process tree for 17344: Error: Command failed: taskkill /pid 17344 /T /F
  ionic:utils-process ERROR: The process "17344" not found.
  ionic:utils-process 
  ionic:utils-process     at ChildProcess.exithandler (child_process.js:303:12)
  ionic:utils-process     at ChildProcess.emit (events.js:315:20)
  ionic:utils-process     at maybeClose (internal/child_process.js:1051:16)
  ionic:utils-process     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  ionic:utils-process   killed: false,
  ionic:utils-process   code: 128,
  ionic:utils-process   signal: null,
  ionic:utils-process   cmd: 'taskkill /pid 17344 /T /F'
  ionic:utils-process } +472ms
  ionic:utils-process onBeforeExit handler: error from function: Error: Command failed: taskkill /pid 17344 /T /F
  ionic:utils-process ERROR: The process "17344" not found.
  ionic:utils-process 
  ionic:utils-process     at ChildProcess.exithandler (child_process.js:303:12)
  ionic:utils-process     at ChildProcess.emit (events.js:315:20)
  ionic:utils-process     at maybeClose (internal/child_process.js:1051:16)
  ionic:utils-process     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  ionic:utils-process   killed: false,
  ionic:utils-process   code: 128,
  ionic:utils-process   signal: null,
  ionic:utils-process   cmd: 'taskkill /pid 17344 /T /F'
  ionic:utils-process } +21ms
  ionic:utils-process error while killing process tree for 2628: Error: Command failed: taskkill /pid 2628 /T /F
  ionic:utils-process ERROR: The process "2628" not found.
  ionic:utils-process 
  ionic:utils-process     at ChildProcess.exithandler (child_process.js:303:12)
  ionic:utils-process     at ChildProcess.emit (events.js:315:20)
  ionic:utils-process     at maybeClose (internal/child_process.js:1051:16)
  ionic:utils-process     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  ionic:utils-process   killed: false,
  ionic:utils-process   code: 128,
  ionic:utils-process   signal: null,
  ionic:utils-process   cmd: 'taskkill /pid 2628 /T /F'
  ionic:utils-process } +40ms
  ionic:utils-process onBeforeExit handler: error from function: Error: Command failed: taskkill /pid 2628 /T /F
  ionic:utils-process ERROR: The process "2628" not found.
  ionic:utils-process 
  ionic:utils-process     at ChildProcess.exithandler (child_process.js:303:12)
  ionic:utils-process     at ChildProcess.emit (events.js:315:20)
  ionic:utils-process     at maybeClose (internal/child_process.js:1051:16)
  ionic:utils-process     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
  ionic:utils-process   killed: false,
  ionic:utils-process   code: 128,
  ionic:utils-process   signal: null,
  ionic:utils-process   cmd: 'taskkill /pid 2628 /T /F'
  ionic:utils-process } +8ms
  ionic:utils-process processExit: exiting (exit code: 1) +4ms
  1. List item