Re: [PhoneGap] ver 2.7 CDVWebViewDelegate: Navigation started when state=1

4,863 views
Skip to first unread message

Shazron

unread,
May 2, 2013, 5:36:56 PM5/2/13
to phonegap
Did it affect any functionality?


On Thu, May 2, 2013 at 7:39 AM, Matt Enderle <ma...@enderletech.com> wrote:
I have a phonegap 2.5 app that works fine.. using jquery mobile and jquery ajax to pull json content. 

I upgraded 2.5 to 2.6, then 2.6 to 2.7 following guides on the website. 

Now when I go to pull the json I get this error in the console...

2013-05-02 10:08:13.214 App[8896:c07] CDVWebViewDelegate: Navigation started when state=1

2013-05-02 10:08:13.215 App[8896:c07] Failed to load webpage with error: (null)


I checked the whitelist and its set to *, I checked that my server side php is sending the correct json and again havent made any changes to it. 

I did also upgrade jquery to 1.9.1 and jquery mobile to 1.3.1

I'm also using localstorage to supply the varibles in the URL to get the json, not sure if that makes a difference though.


Thanks in advance,

Matt Enderle


--
-- 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.
 
 

Ben Hirashima

unread,
May 7, 2013, 1:24:54 AM5/7/13
to phon...@googlegroups.com

i'm having the same problem. the workaround posted by david billamboz didn't solve it for me. i'm opening an external webpage, like this:
<a href="#" onclick="navigator.app.loadUrl('http://touchpilot.com', {openExternal: true})" rel="external" target="_blank">touchpilot.com</a>

it worked on iOS with phonegap 2.6.0, but not with 2.7.0. i get the error ""CDVWebViewDelegate: Navigation started when state=1". anyone got a fix?


On Friday, May 3, 2013 7:43:57 PM UTC-7, asgeo1 wrote:
Yup, same error messages for me.

Also upgraded Cordova from 2.5 -> 2.6 -> 2.7

Also running jQuery Mobile (1.3.1).

My app doesn't make any ajax requests though. For me the messages are triggered when I call $.mobile.changePage() to navigate to an internal page.

When calling $.mobile.changePage, under the hood jQuery Mobile is changing the browser location URL. I suppose that could be what is triggering Cordova to show this message.

Dustin Dempsey

unread,
May 17, 2013, 2:08:04 PM5/17/13
to phon...@googlegroups.com
I too am getting this error when the hashtag changes within my app (navigating to different internal pages within my app). 

montylee

unread,
May 29, 2013, 1:40:43 AM5/29/13
to phon...@googlegroups.com
I have logged this as a bug as my app crashes with this error with PhoneGap 2.7.0:



On Monday, 27 May 2013 16:50:55 UTC+5:30, montylee wrote:
I am getting the same error with 2.7.0. My app crashes after getting this error. The problem is:

CDVWebViewDelegate.m: shouldStartLoadWithRequest(): default: passing nil as error code


Error code is being passed as nil and in CDVInAppBrowser.m: didFailLoadWithError() function, error.localizedDescription is being referenced, which causes a crash. 


For now, i added a check in the above function to put default values for error code if the error object is nil.


Can we log this as a bug somewhere? I couldn't find any bug report link for PhoneGap


On Saturday, 25 May 2013 15:40:35 UTC+5:30, Antonio Sala wrote:
Im getting the same problem too.

Anyone found a solution

ginilf

unread,
May 29, 2013, 9:14:35 AM5/29/13
to phon...@googlegroups.com
Hi Does this happen in versino 2.6 or just 2.7? 

ginilf

unread,
May 29, 2013, 10:42:56 AM5/29/13
to phon...@googlegroups.com
This seems to be an issue with having a URL with #value in the URL, 

I am seeing this cause a load error in the inapp browser as well. 

ginilf

unread,
May 29, 2013, 9:28:20 PM5/29/13
to phon...@googlegroups.com
DavidB - what are the pro's and cons of your workaround? I have very little knowledge of objective-C, so just need to know if commenting out those lines fixes the code or just stops the error showing?

sahmed

unread,
Jun 12, 2013, 4:58:37 PM6/12/13
to phon...@googlegroups.com
I also have the same issue,
But it doesn't affect my application, somehow everything works fine

Does any one know if this error can cause problems in the App Store Submission?

thanks in advance

Ken Whipday

unread,
Jun 13, 2013, 11:37:49 AM6/13/13
to phon...@googlegroups.com
I tried DavidB's suggestion (commenting out lines 100 to 201 in CDVWebViewDelegate.m) and it fixed it for me.  I'm using the in-app browser for oAuth authentication. The browser was hanging with a browser error when the user clicked a button on the page in the browser. After adding the comments it worked.

Stuart Parmenter

unread,
Jun 17, 2013, 8:49:33 PM6/17/13
to phon...@googlegroups.com
This is now even worse in 2.8.x since it is passing an error object in to my MainViewController's didFailLoadWithError function (so I can't just ignore nil errors).  Anyone have a better solution than just commenting out the seemingly broken code?

thanks,
stuart

Farhad Farzaneh

unread,
Jun 18, 2013, 11:57:05 AM6/18/13
to phon...@googlegroups.com
I have posted a fix that addresses the root cause for my use case in https://issues.apache.org/jira/browse/CB-3530.  However, note that my app wasn't crashing, I was just getting this null error messages every time I loaded a new page.

Mary Luksetich

unread,
Jun 18, 2013, 5:16:10 PM6/18/13
to phon...@googlegroups.com
I've realized that I get this error because of ghost clicks and accidental double-taps interrupting the page load process.

Stefan Schiller

unread,
Aug 9, 2013, 6:38:40 AM8/9/13
to phon...@googlegroups.com
Failed to load webpage with error: CDVWebViewDelegate: Navigation started when state=1

I'm getting this error message everytime i click on a link, but the app doesn't crash and seems to be function! But why am i getting this error message?
I'm using phonegap 3 with jquery 1.9.1 and jquery mobile 1.3.2

Ivo Stoilov

unread,
Aug 15, 2013, 2:41:42 AM8/15/13
to phon...@googlegroups.com

Hello Everyone, I am also getting this error , but this time as a result of calling $.mobile.changePage using exactly the same components. Ideas from anyone?

Message has been deleted

Boar

unread,
May 5, 2014, 12:45:33 AM5/5/14
to phon...@googlegroups.com


On Friday, May 3, 2013 12:00:08 PM UTC-4, David Billamboz wrote:
If it helps (I couldn't wait for a proper fix) :

in CDVWebViewDelegate.m, I commented the lines 199 to 201 and it seems to stop breaking the reloading :
//                    if ([_delegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) {
//                        [_delegate webView:webView didFailLoadWithError:nil];
//                    }
 
This worked for me!
Reply all
Reply to author
Forward
0 new messages