Hello,
I am new with Ionic and Angular.
I want to test the Toast Plugin.
First I added it to my project:
cordova plugin add cordova-plugin-x-toast
my page1.ts looks like this:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Toast } from 'ionic-native';
@Component({
selector: 'page-page1',
templateUrl: 'page1.html'
})
export class Page1 {
constructor(public navCtrl: NavController) {
Toast.show("I'm a toast", '5000', 'center').subscribe(
toast => {
console.log(toast);
});
}
}
When I run the app on my Android Device, I get this error:
11-30 04:31:15.341: I/chromium(31584): [INFO:CONSOLE(1)] âNative: tried calling t.show, but the t plugin is not installed.â, source: file:///android_asset/www/build/main.js (1)
11-30 04:31:15.341: I/chromium(31584): [INFO:CONSOLE(1)] âInstall the t plugin: âionic plugin add cordova-plugin-x-toastââ, source: file:///android_asset/www/build/main.js (1)
11-30 04:31:15.341: I/chromium(31584): [INFO:CONSOLE(1)] âUnable to clear the previous observable watch forâ, source: file:///android_asset/www/build/main.js (1)
11-30 04:31:15.341: I/chromium(31584): [INFO:CONSOLE(1)] âTypeError: Cannot read property âhideâ of nullâ, source: file:///android_asset/www/build/main.js (1)
11-30 04:31:15.341: I/chromium(31584): [INFO:CONSOLE(11)] âEXCEPTION: plugin_not_installedâ, source: file:///android_asset/www/build/main.js (11)
11-30 04:31:15.381: I/chromium(31584): [INFO:CONSOLE(1)] âNative: tried calling t.show, but the t plugin is not installed.â, source: file:///android_asset/www/build/main.js (1)
11-30 04:31:15.381: I/chromium(31584): [INFO:CONSOLE(1)] âInstall the t plugin: âionic plugin add cordova-plugin-x-toastââ, source: file:///android_asset/www/build/main.js (1)
11-30 04:31:15.381: I/chromium(31584): [INFO:CONSOLE(1)] âUnable to clear the previous observable watch forâ, source: file:///android_asset/www/build/main.js (1)
11-30 04:31:15.381: I/chromium(31584): [INFO:CONSOLE(1)] âTypeError: Cannot read property âhideâ of nullâ, source: file:///android_asset/www/build/main.js (1)
11-30 04:31:15.381: I/chromium(31584): [INFO:CONSOLE(11)] âEXCEPTION: plugin_not_installedâ, source: file:///android_asset/www/build/main.js (11)
11-30 04:31:15.381: I/chromium(31584): [INFO:CONSOLE(11)] âEXCEPTION: Uncaught (in promise): plugin_not_installedâ, source: file:///android_asset/www/build/main.js (11)
11-30 04:31:15.381: I/chromium(31584): [INFO:CONSOLE(11)] âORIGINAL STACKTRACE:â, source: file:///android_asset/www/build/main.js (11)
11-30 04:31:15.391: I/chromium(31584): [INFO:CONSOLE(11)] âError: Uncaught (in promise): plugin_not_installed
11-30 04:31:15.391: I/chromium(31584): at s (file:///android_asset/www/build/polyfills.js:3:8568)
11-30 04:31:15.391: I/chromium(31584): at file:///android_asset/www/build/polyfills.js:3:8940
11-30 04:31:15.391: I/chromium(31584): at t.invokeTask (file:///android_asset/www/build/polyfills.js:3:14051)
11-30 04:31:15.391: I/chromium(31584): at Object.onInvokeTask (file:///android_asset/www/build/main.js:3:19691)
11-30 04:31:15.391: I/chromium(31584): at t.invokeTask (file:///android_asset/www/build/polyfills.js:3:13987)
11-30 04:31:15.391: I/chromium(31584): at e.runTask (file:///android_asset/www/build/polyfills.js:3:11411)
11-30 04:31:15.391: I/chromium(31584): at i (file:///android_asset/www/build/polyfills.js:3:8028)â, source: file:///android_asset/www/build/main.js (11)
11-30 04:31:15.391: E/chromium(31584): [ERROR:interface_registry.cc(99)] Failed to locate a binder for interface: autofill::mojom::AutofillDriver
11-30 04:31:15.441: I/chromium(31584): [INFO:CONSOLE(19)] âDEVICE READY FIRED AFTERâ, source: file:///android_asset/www/build/main.js (19)
When i try to install the plugin again I get:
Plugin âcordova-plugin-x-toastâ already installed on android.