Black Screen - After adding Ionic wrapper for Cordova Custom Plugin


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



<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns=“” xmlns: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/” target-dir=“src/com/example/” />
< /platform>
< /plugin>

package com.example;

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;

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;


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


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

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

providedIn: “root”,

export class CustomUIService extends IonicNativePlugin {
toast(): void {

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