Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Error: gap_init:2 #8

Open
jgluhov opened this issue Nov 18, 2015 · 27 comments
Open

Error: gap_init:2 #8

jgluhov opened this issue Nov 18, 2015 · 27 comments

Comments

@jgluhov
Copy link

jgluhov commented Nov 18, 2015

This alert has shown up to me after reloading app or update data and browser-sync update my page what should I do to remove it
2015-11-18 17-44-22 iphone 6 - iphone 6 ios 9 1 13b137

@axemclion
Copy link
Member

Looks like cordova.js is not loaded properly. Can you give me a little more detail on how you got to this error ?

@jgluhov
Copy link
Author

jgluhov commented Nov 18, 2015

Parashuram i run command
cordova run ios -- --live-reload --ignore=lib//.
see Iphone 6 and when I change any data in www after update I saw this
error. I can give you my project

On Wed, Nov 18, 2015 at 7:07 PM, Parashuram N notifications@github.com
wrote:

Looks like cordova.js is not loaded properly. Can you give me a little
more detail on how you got to this error ?


Reply to this email directly or view it on GitHub
#8 (comment)
.

@axemclion
Copy link
Member

Could be an error here - https://github.com/nparashuram/cordova-plugin-browsersync/blob/master/lib/pluginHook.js#L34

Basically, when you update any file, cordova prepare run again. Looks like this is messing up the built project.

@jgluhov
Copy link
Author

jgluhov commented Nov 18, 2015

I enter this "cordova build" command before "cordova run ios --
--live-reload --ignore=lib//." and nothing has changed...

On Wed, Nov 18, 2015 at 7:24 PM, Parashuram N notifications@github.com
wrote:

Could be an error here -
https://github.com/nparashuram/cordova-plugin-browsersync/blob/master/lib/pluginHook.js#L34

Basically, when you update any file, cordova prepare run again. Looks
like this is messing up the built project.


Reply to this email directly or view it on GitHub
#8 (comment)
.

@jgluhov
Copy link
Author

jgluhov commented Nov 18, 2015

After make some changes in console I see several Browsers Reloading 3-4 ...
? Is it right ?

On Wed, Nov 18, 2015 at 7:24 PM, Parashuram N notifications@github.com
wrote:

Could be an error here -
https://github.com/nparashuram/cordova-plugin-browsersync/blob/master/lib/pluginHook.js#L34

Basically, when you update any file, cordova prepare run again. Looks
like this is messing up the built project.


Reply to this email directly or view it on GitHub
#8 (comment)
.

@axemclion
Copy link
Member

@jgluhov Has this problem been fixed ? Are you still having this issue ?

@jgluhov
Copy link
Author

jgluhov commented Dec 9, 2015

Yes I have.

On Wed, Dec 9, 2015 at 6:00 PM, Parashuram N notifications@github.com
wrote:

@jgluhov https://github.com/jgluhov Has this problem been fixed ? Are
you still having this issue ?


Reply to this email directly or view it on GitHub
#8 (comment)
.

@axemclion
Copy link
Member

@jgluhov Sorry, did not understand your reply. Did you mean that you are still having this issue, or that you have solved the problem ?

@jgluhov
Copy link
Author

jgluhov commented Dec 14, 2015

Hey I've recorded a video for you.

On Wed, Dec 9, 2015 at 10:23 PM, Parashuram N notifications@github.com
wrote:

@jgluhov https://github.com/jgluhov Sorry, did not understand your
reply. Did you mean that you are still having this issue, or that you have
solved the problem ?


Reply to this email directly or view it on GitHub
#8 (comment)
.

@axemclion
Copy link
Member

@jgluhov Did you mean to share the video in your comment? I don't seem to see the video in this issue.

@jgluhov
Copy link
Author

jgluhov commented Dec 21, 2015

---------- Forwarded message ----------
From: EVGENY GLUKHOV jgluhov@gmail.com
Date: Mon, Dec 14, 2015 at 11:07 AM
Subject: Re: [cordova-plugin-browsersync] Error: gap_init:2 (#8)
To: nparashuram/cordova-plugin-browsersync <
reply@reply.github.com

Hey I've recorded a video for you.

On Wed, Dec 9, 2015 at 10:23 PM, Parashuram N notifications@github.com
wrote:

@jgluhov https://github.com/jgluhov Sorry, did not understand your
reply. Did you mean that you are still having this issue, or that you have
solved the problem ?


Reply to this email directly or view it on GitHub
#8 (comment)
.

@axemclion
Copy link
Member

@jgluhov Looks like there could be a problem when you are replying via email client. I am still not able to see the video.

@jgluhov
Copy link
Author

jgluhov commented Dec 22, 2015

How can I send you a video file ?

On Tue, Dec 22, 2015 at 2:37 AM, Parashuram N notifications@github.com
wrote:

@jgluhov https://github.com/jgluhov Looks like there could be a problem
when you are replying via email client. I am still not able to see the
video.


Reply to this email directly or view it on GitHub
#8 (comment)
.

@axemclion
Copy link
Member

@jgluhov You could upload it to something like dropbox, or youtube and send a link ?

@jgluhov
Copy link
Author

jgluhov commented Dec 23, 2015

Ok I will do it

On Tue, Dec 22, 2015 at 8:08 PM, Parashuram N notifications@github.com
wrote:

@jgluhov https://github.com/jgluhov You could upload it to something
like dropbox, or youtube and send a link ?


Reply to this email directly or view it on GitHub
#8 (comment)
.

@jgluhov
Copy link
Author

jgluhov commented Dec 23, 2015

https://www.dropbox.com/s/jcjh0znor6i4lkg/14%20Dec%202015%2011_04_52%20AM.m4a?dl=0

On Tue, Dec 22, 2015 at 8:08 PM, Parashuram N notifications@github.com
wrote:

@jgluhov https://github.com/jgluhov You could upload it to something
like dropbox, or youtube and send a link ?


Reply to this email directly or view it on GitHub
#8 (comment)
.

@jgluhov
Copy link
Author

jgluhov commented Dec 23, 2015

:) It's audio)) Just a moment I will make a video)

On Wed, Dec 23, 2015 at 11:36 AM, EVGENY GLUKHOV jgluhov@gmail.com wrote:

https://www.dropbox.com/s/jcjh0znor6i4lkg/14%20Dec%202015%2011_04_52%20AM.m4a?dl=0

On Tue, Dec 22, 2015 at 8:08 PM, Parashuram N notifications@github.com
wrote:

@jgluhov https://github.com/jgluhov You could upload it to something
like dropbox, or youtube and send a link ?


Reply to this email directly or view it on GitHub
#8 (comment)
.

@mnasyrov
Copy link

I faced with a similar issue too when I run cordova run browser -- --livereload and opened http://localhost:3000 after that.
Also I noticed in logs that the browser-sync serves android and ios assets:

[BS] Serving files from: platforms/android/assets/www
[BS] Serving files from: platforms/ios/www

Maybe the issue is related with serving incorrect platform assets?

@axemclion
Copy link
Member

@mnasyrov @jgluhov I am planning to retire this project in favor of Taco-livereload. That is also based on pretty much the same code, and I am now a PM on that project.
That project will also have more devs working on it, so will have much more support as an official project.

Would that fulfill your needs ? Are there anything that this project has, that taco-livereload does not have ?

@rixo
Copy link

rixo commented Mar 14, 2016

Hi! Can you point to some documentation for taco-livereload? I didn't know taco, I just found about it in your comment, but it seems to me that it isn't so easy to integrate in an existing project, is it? The plugin approach of this project and the focus on the browser-sync concern is far more appealing to me.

Edit And also, there is that that I was fearing :(

TACO2114: Error: Your current platform is not supported: linux

@axemclion
Copy link
Member

@rixo Oooh -- that is an ugly error. There is no reason that taco-livereload should need that. Maybe we could see if we release taco-livereload as a standalone utility instead.

Taco (stands for Tools for Apache Cordova) and has a bunch of utilities on top of Cordova - including things like a newer version of Ripple, way to install requirements, etc.

@arihantdaga
Copy link

arihantdaga commented Jan 22, 2017

Is this issue resolved ? I am still facing the same issue.
Apk is built, launch is successfull. but getting an error - gap_init:2 when try to open the 192.168.0.12:8100 in my mobile browser. and app throws an error - failed to connect to server 192.168.0.12:8100

@rixo
Copy link

rixo commented Jan 22, 2017

@arihantdaga As pointed in the first comment, this error is indicative that Cordova is not loaded. And indeed, it is not loaded if you access your application directly from a browser, it is only included in the mobile build. If you setup is correct, you'll have browser-sync reloading in the app itself. Launch the app from your device or emulator, and the app webview will reload when files change.

@arihantdaga
Copy link

@rixo , Thank you vey much rixo. Now i understand.
But there is also this issue that whenever i am doing this - "ionic run android -l -c". The app which is built and launched in my mobile fails to connect to the liverload server and hence always on opening my app, it shows "Unable to conenct to the server 192.168.0.116:8100" and app crashes. Although with this error i have seen some anomalies. sometimes this error occurs, but sometimes it launches app successfully.

@rixo
Copy link

rixo commented Jan 24, 2017

@arihantdaga I remember I had some difficulties passing this step too, but you're now in the right tracks. You're almost there I think; once you'll have figured the issue with the connection, it should work and it's pretty flawless browsersync then. Quite the difference in feedback loop, as compared as rebuilding the app with cordova each time!

Unfortunately, I don't remember how I solved this myself, and I don't have access to the project I was working on anymore... Check the Cordova access control policy, I think it may have been hardened on the Cordova side since this project has been written. Ensure you don't have a CORS issue too. When your app is launched, you should be able to debug its webview with chrome://inspect to gain some insight... Good luck!

@clChenLiang
Copy link

I also have see this affair.but not as you find that .I have place my code or project on the Node.js Server , than visit the index.html by chrome browser on my mobile phone . Then the web has popup the panel,for that gap_init:2.
I think that is an error that not right load the cordova.js module.

@StefansArya
Copy link

StefansArya commented Feb 7, 2018

Usually it happen because browser platform haven't being added
cordova platform add browser
You may need to remove it first if still happen..

Or..
Put this on the html header before any script..
<script type="text/javascript">window.prompt = console.prompt = function(){};</script>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants