InAppBrowser broken in Android RC.3


#1

Hi

Since I updated to RC.3 the InAppBrowser is crashing my app whenever I open it in an Android device. The code I’m using is very simple:

import {InAppBrowser} from ‘ionic-native’;

openInAppBrowser(url){
let browser = new InAppBrowser(url, ‘_blank’);
browser.show();
}

I tried using _system too and the app crashes as soon as I call openInAppBrowser. Everything works Ok in iOS, the app opens the InAppBrowser and loads the url.

Is someone else experiencing the same issue?


#2

Android RC.3 / cordova-plugin-inappbrowser 1.5.0

I do:

public open() {
    new InAppBrowser(myUrl, '_blank', 'location=no');
}

works for me.


#3

I tried your method and it crashes the app in 2 devices. I have RC.3 and cordova-plugin-inappbrowser 1.5.0 too…

In your package.json in the cordova plugins do you have the cordova-plugin-inappbrowser listed? Because after installing the plugin with ionic plugin add cordova-plugin-inappbrowser the plugin installs but it is not added to the cordova plugins list in my package.json file.


#4

Even though it is not in the package.json file I checked and the plugin is present in the android.json file. I do not know what is going on. I’ll keep trying other things…


#5

I tried on an old iPhone and nexus 5x, both worked fine…strange. on which did it crash for you?


#6

I tried it in a Samsung Galaxy S6 Edge and in a Moto G (3rd gen). I sent the error details to the developer console in android and the error shown is as follows in both devices:

android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:2558)
at android.content.res.Resources.getDrawable(Resources.java:2001)
at android.content.res.Resources.getDrawable(Resources.java:1987)
at android.content.res.Resources.getDrawable(Resources.java:1961)
at org.apache.cordova.inappbrowser.InAppBrowser$5.run(InAppBrowser.java:606)
at android.app.Activity.runOnUiThread(Activity.java:6035)
at org.apache.cordova.inappbrowser.InAppBrowser.showWebPage(InAppBrowser.java:779)
at org.apache.cordova.inappbrowser.InAppBrowser$1.run(InAppBrowser.java:198)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

#7

Freak … didn’t tried on these devices, I’m a little bit concern now :frowning:


#8

I applied ionic plugin remove cordova-plugin-inappbrowser and then ionic install… and now it is working. It is very weird because after starting the new project from scratch I installed the plugin with the same command.