Problems with IONIC 2 in various aspects

Asked

Viewed 703 times

0

The big question is: What happened to IONIC after the updates.

A few months ago I started a project with IONIC 2 for a client. Due to some setbacks of mine and also on the part of the client, the project stopped. However, we now return to active and I come across several commands that no longer work. For more than 3 days I’m having problems with settings and only now managed to run the app on my smartphone with errors.

Well, I’m not here to cry kk so there goes my doubts:

First problem the Browsertab, Native IONIC plugin, no longer works. Once already executed the code previously successfully, I only downloaded from the repository and started again on my smartphone, but it results in nothing. It just stopped working. I tried debugging with the command cordova run android --livereload --device, but terminal closes every time the app opens on my phone (second problem), it being impossible to get any error message to be able to identify the cause. Below is the code that no longer works.

  constructor(public navCtrl: NavController, 
public navParams: NavParams,
private browserTab: BrowserTab) {}

openPage(option) {
switch (option) {
  case 0:
      this.browserTab.openUrl("https://pag.ae/bkjsxHd");
    break;

  case 1:
      this.browserTab.openUrl("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8RV2DK95S29LJ");
    break;

  default:
    break;
}

}

I’ve already accomplished the npm install, already installed the browserTab plugin following the following link Documentation for the browserTab. I run Livereload according to the documentation here that is no live thing rsrs.

Anyway, I’m lost. I’ve researched enough and without result. To more than 3 unproductive days without knowing more what to do.

Good, below also my dependencies for analysis:

"dependencies": {
    "@angular/common": "4.0.0",
    "@angular/compiler": "4.0.0",
    "@angular/compiler-cli": "4.0.0",
    "@angular/core": "4.0.0",
    "@angular/forms": "4.0.0",
    "@angular/http": "4.0.0",
    "@angular/platform-browser": "4.0.0",
    "@angular/platform-browser-dynamic": "4.0.0",
    "@ionic-native/browser-tab": "^3.4.4",
    "@ionic-native/core": "3.6.0",
    "@ionic-native/splash-screen": "3.4.2",
    "@ionic-native/status-bar": "3.4.2",
    "@ionic/storage": "2.0.1",
    "cordova-android": "^6.2.3",
    "cordova-plugin-browsertab": "^0.2.0",
    "cordova-plugin-compat": "^1.0.0",
    "cordova-plugin-console": "^1.0.5",
    "cordova-plugin-device": "^1.1.4",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "^2.2.1",
    "cordova-plugin-whitelist": "^1.3.1",
    "ionic-angular": "3.0.0",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "^0.8.4"
},
"devDependencies": {
    "@ionic/app-scripts": "1.3.0",
    "@ionic/cli-plugin-ionic-angular": "1.3.2",
    "typescript": "~2.2.1"
},
"cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-statusbar",
    "cordova-plugin-console",
    "cordova-plugin-device",
    "cordova-plugin-splashscreen",
    "ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"description": "com.semadpb.www: An Ionic project",
"cordova": {
    "plugins": {
        "cordova-plugin-console": {},
        "cordova-plugin-device": {},
        "cordova-plugin-splashscreen": {},
        "cordova-plugin-statusbar": {},
        "cordova-plugin-whitelist": {},
        "ionic-plugin-keyboard": {},
        "cordova-plugin-browsertab": {}
    },
    "platforms": [
        "android"
    ]

Well, I appreciate any help. Because working with IONIC now following the documentation itself is not producing success. No waiting...

  • 1

    You ran with Ionic to run in the browser and see if something appears on the console? I have been following Ionic from version 2 to the current one and had difficulties at first, but now every update I have not encountered problems when I follow the information on https://github.com/ionic-team/ionic/releases . The biggest change I had to make was when it changed from version 2.3.0 to version 3.0.0 which uses angular 4. Since I don’t know the version you used before I advise you to update Node, npm, Ionic and Cordova, start a new project from scratch and go adding your pages and go checking every error.

  • Thanks for the answer! Using Ionic serves yes and Browsertab does not work either. Searching now in the morning, I was able to debug the app running directly by mobile through a tool google Chrome://Inspect/#Devices (the tip is). And by clicking on the button to run Browsertab it indicates the following error: tried Calling Browsertab.openUrl, but the Browsertab plugin is not installed.Install the Browsertab plugin: 'Ionic plugin add Cordova-plugin-browsertab'. Did I forget any commands? I started the add Platform, build and run normally. I thank you once again!

  • An observation. As said before, I installed browserTab as documentation and already performed the verification and the same is imported in the providers in app.module.ts. I don’t know what step I’ve forgotten.

  • 1

    runs Ionic Cordova plugin list and see if it appears in the plugins list.

  • Vlw @Andrévicente for the help. I understood the problem and solved it. I will explain in the answer.

1 answer

1


Well, after a lot of trying I figured out the problem:

1 - Browsertab has to be installed with NPM and CORDOVA. As I had only downloaded the project and only ran npm install, I failed to install the plugin through Cordova before building the platform and generating apk. Because of that, it didn’t work. (However, it was strange because the apk q had already generated once before (a couple of months ago when I started the app), tbm had stopped working on my phone without me having touched it. But anyway, it’s working again).

2 - The livereload seems to me that really has some bugs, so just you install with the cordova run android/ios --device and then use a google tool Chrome q is the chrome://inspect/#devices, just the device is connected via usb cable. (source where I found the tip: here).

Well, that’s it. I hope to help others with the same problem, if there are.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.