Buzzinga
Buzzinga

Reputation: 401

Ionic 4 - InAppBrowser plugin causes error on ios: exc_bad_instruction (code=exc_i386_invop subcode=0x0)

I used cordova-plugin-inappbrowser in my ionic project. When i run the app on android, inappbrowser works just fine, it can be opened and closed. The problem is that when i run the app on ios (both on simulator and a real device) it gives me the error:

exc_bad_instruction (code=exc_i386_invop subcode=0x0)

and the app crashes. I also removed the options but no luck.
Here is the code block i used:

openLoginBrowser() {
    const browser = this.inapp.create('...URL_HERE...', '_blank', {
      zoom: 'no',
      hideurlbar: 'yes'
    });
    browser.on('loadstart').subscribe(response => {
      ...
    });
  }

package.json :

...  
"@ionic/angular": "^4.7.1",  
"@ionic-native/in-app-browser": "^5.20.0",  
"cordova-plugin-inappbrowser": "^3.2.0",  
"@capacitor/cli": "^1.2.1",  
"@capacitor/android": "^1.2.0",
"@capacitor/core": "^1.2.1",
"@capacitor/ios": "^1.3.0",
...

Upvotes: 0

Views: 1228

Answers (1)

jcesarmobile
jcesarmobile

Reputation: 53301

Latest cordova-plugin-inappbrowser doesn't work with Capacitor because it relies in having cordova-plugin-wkwebview-engine or cordova-plugin-ionic-webview installed, and both of them are incompatible with Capacitor.

The plugin needs to be updated to remove those checks.

Upvotes: 2

Related Questions