1

So I'm trying to create a plugin that uses PrettyDialog (https://github.com/mjn1369/PrettyDialog) using the latest NativeScript seed.

However I've run into the following error when compiling:

Error: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

That happens using the following code, and calling show() (TypeScript):

export class PrettyAlert {
  show() {
    const alert = this.createAlert();
  }

  createAlert(width?: number) {
    return new libs.mjn.prettydialog.PrettyDialog(app.android.context);
  }
}

I've been looking into the error here (pure Android): You need to use a Theme.AppCompat theme (or descendant) with this activity But none of the solutions have worked.

I figure it possible somehow, but I'm new a plugin building, and I'm sure there's some quirks I need to understand.

DarkNeuron
  • 7,981
  • 2
  • 43
  • 48

1 Answers1

1

There are similar plugins - fancyalert / cfalert already if you are not very choosy about PrettyDialog.

NativeScript introduced support for AppCompatActivity from v5.x which seems just hit live. You should bypass this error if you upgrade to latest version.

Manoj
  • 21,753
  • 3
  • 20
  • 41