InAppBrowser plugin Cannot read property 'install' of undefined.

2,620 views
Skip to first unread message

Mick Underwood

unread,
Feb 11, 2014, 11:46:58 AM2/11/14
to phon...@googlegroups.com
Hi.
Using Corodva 3 I'd like to install the InAppBrowser plugin. I tried it with 
and
but it fails in each case with 
[error] cannot read property 'install' of undefined
Other Cordova 3 plugins I have added using this new Cordova 3 method have installed just fine (except that plugins.js ends up in the .staging directory).
Any ideas?

Shai Petel

unread,
Feb 12, 2014, 1:11:13 PM2/12/14
to phon...@googlegroups.com
I wish someone could help.
I installed it with no problem last week, uninstalled it.
Today I am trying to install it again (add it to my project) and getting this error.

Seems like a temporary glitch in the server serving this plugin...

Shai Petel

unread,
Feb 12, 2014, 1:22:56 PM2/12/14
to phon...@googlegroups.com
Found and fixed my problem:

since I installed and uninstalled the plugin, it created a plugin empty folder in my platforms and didn't clean it up when I removed it.

I deleted my platforms and re-created them, now I can install the plugin with no problem.

so I think the remove plugin does not clean up the platforms.

Shai Petel

unread,
Feb 12, 2014, 2:08:58 PM2/12/14
to phon...@googlegroups.com

Correction:

 

Now, I can install the plugin, and it goes into the platform, but none of the other plugins go into the platform!

 

I ran install on all other plugins, now all of them go into the platform on build - only none of them work!

 

Help!!!

Shazron

unread,
Feb 12, 2014, 2:33:00 PM2/12/14
to phonegap


--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Shai Petel

unread,
Feb 12, 2014, 2:42:29 PM2/12/14
to phon...@googlegroups.com
thanks,

nope,
I solved it by running phonegap create again, created a new empty project, moved my files into it and not it works.

seems as if something in the remove plugin messes everything up once you have wp8 platform (at least that's what I had).

in the new project it works, I am now comparing files to see if I can figure out why.

Shai Petel

unread,
Feb 12, 2014, 2:46:08 PM2/12/14
to phon...@googlegroups.com
I think I found the issue,

there is a wp8.json file created in the plugins folder.

Once I delete it, delete the platform I can then create the platform and the app is working again.

Thanks.

kakra assasie

unread,
Feb 12, 2014, 3:13:33 PM2/12/14
to phon...@googlegroups.com
I was also having your initial error of Cannot read property 'install' of undefined. What i did was i updates plugman (npm install -g plugman). I was on version 0.17 and after ugrade to the latest, the problem went away. Check your version of plugman. plugman -v

Shai Petel

unread,
Feb 12, 2014, 7:49:02 PM2/12/14
to phon...@googlegroups.com
I'm not using plugman, I was using "phonegap plugin add" command.
I understand it is easier than plugman, what is the benefits of using plugman to add plugins?
Thanks.

Shazron

unread,
Feb 12, 2014, 11:20:02 PM2/12/14
to phonegap
Like my last post highlighted the post by David Kemp, *update* your cordova CLI tool. Personally I use cordova instead of phonegap (at the moment).

Both phonegap and cordova CLI tools install the plugman tool as a dependency.


--

Shai Petel

unread,
Feb 13, 2014, 12:58:52 AM2/13/14
to phon...@googlegroups.com
Hi Shazron,

2 things:
1. Is there a difference between cordova or phonegap? I understand it is only a name change currently.

2. I think I am using the latest, no?
C:\Users\Shai>phonegap version
3.3.0-0.19.5

it happens to me on that version, on windows 8.1 64 bit.

Shai Petel

unread,
Feb 13, 2014, 1:01:12 AM2/13/14
to phon...@googlegroups.com
Sorry, just noticed there is 0.19.06...

updating now, thanks.

Mick Underwood

unread,
Feb 13, 2014, 6:25:54 AM2/13/14
to phon...@googlegroups.com
Hmm. Well, I updated to phonegap 3.3.0-0.19.6 and tried again. Same error. So I tried using plugman. That complained that the version script didn't run, which didn't seem to be a big deal, but also that it didn't find the manifest where it expected it to be. So I copied the manifest to where it wanted it to be and tried again. This time it complained that the files it had succeeeded in downloading last time already existed. So I deleted those and eventually it 'succeeded', though it put the plugin package in an unexpected place. So I dug around and copied the package to the right place and then discovered a new cordova_plugins.js file with only a reference to InAppBrowser.js in it, so I copied that entry on to the end of my existing cordova_plugins.js. The I added the feature to config.xml (it hadn't been added automatically). This is all a bit puzzling, as earlier versions had been placing plugins and an updated cordova_plugins.js in the .staging directory - not where I expected them, but at least I had learnt where to find them.
Then I tested the app and .... well, I don't know whether it worked or not. What it should do is open a pdf that the application has previously saved. I get that as a bytestream from a server and save it as a blob with a pdf extension. In iOS I just use the new Blob() constructor and I get a perfect pdf. With android new Blob() fails, so I use Blobbuilder and end up with a file with a pdf extension, but which no app recognizes as an actual pdf. So maybe that's why window.open now doesn't appear to do anything. I guess I need to add some event listeners to see if anything at all is happening. It all seems a major faff just to open a window.

Mick Underwood

unread,
Feb 13, 2014, 6:43:24 AM2/13/14
to phon...@googlegroups.com
On Thursday, February 13, 2014 11:25:54 AM UTC, Mick Underwood wrote:
Hmm. Well, I updated to phonegap 3.3.0-0.19.6 and tried again. Same error. So I tried using plugman. That complained that the version script didn't run, which didn't seem to be a big deal, but also that it didn't find the manifest where it expected it to be. So I copied the manifest to where it wanted it to be and tried again. This time it complained that the files it had succeeeded in downloading last time already existed. So I deleted those and eventually it 'succeeded', though it put the plugin package in an unexpected place. So I dug around and copied the package to the right place and then discovered a new cordova_plugins.js file with only a reference to InAppBrowser.js in it, so I copied that entry on to the end of my existing cordova_plugins.js. The I added the feature to config.xml (it hadn't been added automatically). This is all a bit puzzling, as earlier versions had been placing plugins and an updated cordova_plugins.js in the .staging directory - not where I expected them, but at least I had learnt where to find them.
Then I tested the app and .... well, I don't know whether it worked or not. What it should do is open a pdf that the application has previously saved. I get that as a bytestream from a server and save it as a blob with a pdf extension. In iOS I just use the new Blob() constructor and I get a perfect pdf. With android new Blob() fails, so I use Blobbuilder and end up with a file with a pdf extension, but which no app recognizes as an actual pdf. So maybe that's why window.open now doesn't appear to do anything. I guess I need to add some event listeners to see if anything at all is happening. It all seems a major faff just to open a window.
UPDATE: Hmmm. Looks like it hasn't worked after all. I added an event listener for the loadstart event, but that seems no to fire when I tap the button that calls window.open. However, in eclipse's logcat I do see:  onMessage(onPageStarted,file:///mnt/sdcard/Something%20for%20Tycho.pdf) and onMessage(onPageFinished,file:///mnt/sdcard/Something%20for%20Tycho.pdf), which looks like something's going on. I just don't know what.


lulurun

unread,
Feb 19, 2014, 1:05:55 PM2/19/14
to phon...@googlegroups.com
looks like some recent changes broke the install process.
I solved by the following:

2. cd cordova-plugin-inappbrowser
3. git checkout 3.1.0
4. cd $MY_PHONEGAP_APP
5. phonegap local plugin add /.../cordova-plugin-inappbrowser

then everything works fine. ...
the "HEAD" of plugins are always (maybe not so often) broken, better to fork the "stable" version on github, add do "plugin add" from your own repos

Appsotutely

unread,
Feb 19, 2014, 9:46:20 PM2/19/14
to phon...@googlegroups.com
I had a bunch of problems yesterday trying to newly add the InAppBrowser plugin for Android/iOS.  Fortunately, I had a prior successful install of the plugin, so I grabbed that folder, copied it to another location and used it as my source.  The Device and Console plugins installed fine for both platforms, and InAppBrowser installed fine if I only had the iOS platform, but if I also have Android, it's still currently throwing the error and leaves the plugin in the semi-installed state, throwing errors whether I try to re-install or remove it.

Where can I report these kinds of issues?

Perry

Alain Bartolo

unread,
Feb 25, 2014, 5:49:34 AM2/25/14
to phon...@googlegroups.com
I tried what you said. The cloning worked.

But when I try git checkout 3.1.0 or git checkout 0.3.1 (which seems to be the correct version), I get the following errors : 

error: pathspec '3.1.0' did not match any file(s) known to git.

error: pathspec '0.3.1' did not match any file(s) known to git.

Do I need to cd into a subdirectory of cordova-plugin-inappbrowser ? 

Thanks.

Bart Johnston

unread,
Feb 27, 2014, 3:40:32 PM2/27/14
to phon...@googlegroups.com
I ran into exactly the same problem.  Note that the release numbers for the plugin are in the format "r0.3.1", but I still had the same problem with that release so I tried stepping back to "r0.3.0" which DID install successfully.

So, follow lulurun's instructions above, but in step 3, you should "git checkout r0.3.0"

Good luck
Reply all
Reply to author
Forward
0 new messages