Black Screen - After adding Ionic wrapper for Cordova Custom Plugin

Hi,

I as using ionic version 4.12.0 - Angular and Cordova version 12.0.0

After adding Ionic wrapper for Cordova custom plugin using --link created using plugman, the app screen goes blank. I have created Ionic wrapper as below

image

plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns=“http://apache.org/cordova/ns/plugins/1.0” xmlns:android=“http://schemas.android.com/apk/res/android"id="custom-ui-plugin” version=“1.0.0”>
< name> CustomUI
< description>Paytm Custom UI plugin
< license>MIT
< keywords>
< !-- android -->
< platform name=“android”>


< !-- This is the window CustomUI name you want, like window.MyCordovaPlugin -->
< clobbers target=“PaytmCustomUIPlugin” />
< /js-module>
< config-file target=“res/xml/config.xml” parent="/*">
< feature name=“CustomUI”>
< param name=“android-package” value=“com.example.CustomUI”/>
< /feature>
< /config-file>
< source-file src=“src/android/com/example/CustomUI.java” target-dir=“src/com/example/” />
< /platform>
< /plugin>

CustomUI.java

package com.example;

import android.app.Activity;
import android.util.Log;
import android.widget.Toast;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.CordovaPlugin;
import org.json.JSONArray;
import org.json.JSONException;

public class CustomUI extends CordovaPlugin {
private static final String TAG = “CustomUI”;
private Activity activity;

@Override
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
super.initialize(cordova, webView);
Log.d(TAG, “Initializing MyCordovaPlugin”);
activity = cordova.getActivity();
}

public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
if(action.equals(“toast”)) {
Toast.makeText(activity, “toast”, Toast.LENGTH_LONG).show();
}
return false;
}
}


package.json

{
“name”: “CustomUI”,
“version”: “1.0.0”,
“cordova”: {
“id”: “custom-ui-plugin”,
“platforms”: [
“android”
]
},
“description”: “Paytm Custom UI SDK Plugin”
}


custom-ui.service.ts

import { Injectable } from “@angular/core”;
import { Plugin, Cordova, IonicNativePlugin } from “@ionic-native/core”;

@Plugin({
pluginName: “CustomUI”, // should match the name of the wrapper class
plugin: “custom-ui-plugin”, // NPM package name
pluginRef: “custom.ui.plugin”, // name of the object exposed by the plugin
repo: “”, // plugin repository URL
platforms: [“Android”], // supported platforms
})

@Injectable({
providedIn: “root”,
})

export class CustomUIService extends IonicNativePlugin {
@Cordova()
toast(): void {
return;
}
}


I am new to this and I have to create a cordova plugin for Native android UI to add in my ionic project.
Is it possible to add native Ui component using cordova plugin in ionic?
Please help