crash on phonegap app startup

1,488 views
Skip to first unread message

Calgacus

unread,
Oct 12, 2011, 10:37:24 AM10/12/11
to phonegap
when I try to run my ap in my browser I now get a SIGABRT right on
this line in AppDeleagte.m
int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");

When I click continue it stays there, maybe retrying, not sure.

tHe last thing I changed in my app was just some javascript code
relating to my url history and I don't see how it could cause a crash
right off the get go when my app is still on the PhoneGap splash
screen.

Anyone else see this ?
I am on xcode 4, phonegap 1.1.0 running in iphone sim for iOS 4.3

Calgacus

unread,
Oct 12, 2011, 10:39:21 AM10/12/11
to phonegap
Sorry I meant in the file main.m

Calgacus

unread,
Oct 12, 2011, 10:46:44 AM10/12/11
to phonegap
a bit deeper, in the AppDelegate.m file the sigabrt seems to stem from
this line 74:
return [ super webViewDidFinishLoad:theWebView ];

the other code i can see is all assembler. eg in
UIApplication_main : 0x0007bc93 <+1160> xor %eax,%eax

Calgacus

unread,
Oct 12, 2011, 11:28:15 AM10/12/11
to phonegap
here is what my output console has to say about whatever is going on:

2011-10-12 11:06:03.203 myapp[300:2103] ERROR whitelist rejection:
url='http://maps.gstatic.com/intl/en_us/mapfiles/api-3/6/8/main.js'
2011-10-12 11:06:03.205 myapp[300:2103] ERROR whitelist rejection:
url='http://maps.gstatic.com/intl/en_us/mapfiles/api-3/6/8/main.js'
2011-10-12 11:06:03.205 myapp[300:2103] ERROR whitelist rejection:
url='http://maps.gstatic.com/intl/en_us/mapfiles/api-3/6/8/main.js'
2011-10-12 11:06:03.338 myapp[300:207] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '-
[__NSCFDictionary setObject:forKey:]: attempt to insert nil value
(key: gap)'
*** Call stack at first throw:
(
0 CoreFoundation 0x0180a5a9
__exceptionPreprocess + 185
1 libobjc.A.dylib 0x0195e313
objc_exception_throw + 44
2 CoreFoundation 0x017c2ef8 +[NSException
raise:format:arguments:] + 136
3 CoreFoundation 0x017c2e6a +[NSException
raise:format:] + 58
4 CoreFoundation 0x01808e15 -[__NSCFDictionary
setObject:forKey:] + 293
5 myapp 0x00024871 -[PhoneGapDelegate
deviceProperties] + 545
6 myapp 0x00024e0e -[PhoneGapDelegate
webViewDidFinishLoad:] + 222
7 myapp 0x00002f9a -[AppDelegate
webViewDidFinishLoad:] + 234
8 CoreFoundation 0x0177ac7d __invoking___ + 29
9 CoreFoundation 0x0177ab51 -[NSInvocation
invoke] + 145
10 CoreFoundation 0x017a8858 -[NSInvocation
invokeWithTarget:] + 72
11 CoreFoundation 0x0177ba04 ___forwarding___ +
1124
12 CoreFoundation 0x0177b522
_CF_forwarding_prep_0 + 50
13 CoreFoundation 0x0177ac7d __invoking___ + 29
14 CoreFoundation 0x0177ab51 -[NSInvocation
invoke] + 145
15 WebCore 0x02cc4140
_ZL20HandleDelegateSourcePv + 64
16 CoreFoundation 0x017eb8ff
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
17 CoreFoundation 0x0174988b
__CFRunLoopDoSources0 + 571
18 CoreFoundation 0x01748d86 __CFRunLoopRun +
470
19 CoreFoundation 0x01748840
CFRunLoopRunSpecific + 208
20 CoreFoundation 0x01748761 CFRunLoopRunInMode
+ 97
21 GraphicsServices 0x01a421c4 GSEventRunModal +
217
22 GraphicsServices 0x01a42289 GSEventRun + 115
23 UIKit 0x0007bc93 UIApplicationMain
+ 1160
24 myapp 0x00002b7f main + 127
25 myapp 0x00002af5 start + 53
26 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'


So i added the *.gstatic.com (which i never had to do before) to my
extrernal urls and i still get:
2011-10-12 11:14:28.553 myapp[478:207] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '-
[__NSCFDictionary setObject:forKey:]: attempt to insert nil value
(key: gap)'
*** Call stack at first throw:
(
0 CoreFoundation 0x0180a5a9
__exceptionPreprocess + 185
1 libobjc.A.dylib 0x0195e313
objc_exception_throw + 44
2 CoreFoundation 0x017c2ef8 +[NSException
raise:format:arguments:] + 136
3 CoreFoundation 0x017c2e6a +[NSException
raise:format:] + 58
4 CoreFoundation 0x01808e15 -[__NSCFDictionary
setObject:forKey:] + 293
5 myapp 0x00024871 -[PhoneGapDelegate
deviceProperties] + 545
6 myapp 0x00024e0e -[PhoneGapDelegate
webViewDidFinishLoad:] + 222
7 myapp 0x00002f9a -[AppDelegate
webViewDidFinishLoad:] + 234
8 CoreFoundation 0x0177ac7d __invoking___ + 29
9 CoreFoundation 0x0177ab51 -[NSInvocation
invoke] + 145
10 CoreFoundation 0x017a8858 -[NSInvocation
invokeWithTarget:] + 72
11 CoreFoundation 0x0177ba04 ___forwarding___ +
1124
12 CoreFoundation 0x0177b522
_CF_forwarding_prep_0 + 50
13 CoreFoundation 0x0177ac7d __invoking___ + 29
14 CoreFoundation 0x0177ab51 -[NSInvocation
invoke] + 145
15 WebCore 0x02cc4140
_ZL20HandleDelegateSourcePv + 64
16 CoreFoundation 0x017eb8ff
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
17 CoreFoundation 0x0174988b
__CFRunLoopDoSources0 + 571
18 CoreFoundation 0x01748d86 __CFRunLoopRun +
470
19 CoreFoundation 0x01748840
CFRunLoopRunSpecific + 208
20 CoreFoundation 0x01748761 CFRunLoopRunInMode
+ 97
21 GraphicsServices 0x01a421c4 GSEventRunModal +
217
22 GraphicsServices 0x01a42289 GSEventRun + 115
23 UIKit 0x0007bc93 UIApplicationMain
+ 1160
24 myapp 0x00002b7f main + 127
25 myapp 0x00002af5 start + 53
26 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
[Switching to process 478 thread 0x207]
sharedlibrary apply-load-rules all
Current language: auto; currently objective-c
(gdb)

Hugo

unread,
Oct 12, 2011, 3:16:39 PM10/12/11
to phon...@googlegroups.com
I am seeing the exact same problem here after upgrading from PhoneGap 0.9.6 to 1.1.0. PLease post here if you make any progress, I will do the same.

My stack trace is precisely the same & happens at startup:

2011-10-12 11:48:08.011 ngc[1500:307] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: gap)'

*** Call stack at first throw:
(
0   CoreFoundation                      0x314d0987 __exceptionPreprocess + 114
1   libobjc.A.dylib                     0x319a149d objc_exception_throw + 24
2   CoreFoundation                      0x314d07c9 +[NSException raise:format:arguments:] + 68
...etc

Calgacus

unread,
Oct 12, 2011, 4:12:08 PM10/12/11
to phonegap
Will do,
BTW, I just tried it in xcode 4.2 with ios5 and same the thing
happened.
I guess I'll have to recreate my project again and see if that helps,
i hate to do that though, seems like there is a bug that should be
fixed rather than just worked around.

Hugo

unread,
Oct 12, 2011, 7:34:19 PM10/12/11
to phon...@googlegroups.com
My problem went away - I couldn't pinpoint exactly the source of the problem, but the combination of restarting my Mac & cleaning up my Framework Search Path (Target > Build Settings > Search paths), seemed to have fixed it

Calgacus

unread,
Oct 13, 2011, 8:58:23 AM10/13/11
to phonegap
what did you set your search path to?

Calgacus

unread,
Oct 13, 2011, 9:31:37 AM10/13/11
to phonegap
I tried recreating my project and after copying in my www and adding
my external urls I now get this error when i try to run : Automatic
Reference Counting Issue: ARC forbids explicit message send of
'dealloc'

I created a new phonegap proj wuith just the default www and it runs
without eoor. what setting or file is corrupted?

Calgacus

unread,
Oct 13, 2011, 11:00:20 AM10/13/11
to phonegap
getting these error messages in my console again. I reverted to my
original since mak=ing new projects did not fix the issue. Could it
have something to do with using architecture armv7 instead of armv6?
If so how do I change it to armv6? I am using the latest xcode 4.2
with iOS 5, it doesn't seem to have iOS 4.x SDKs available. Can I get
them separetly and install to xcode?


2011-10-13 10:56:16.442 DromeiOS[5765:207] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '-
[__NSCFDictionary setObject:forKey:]: attempt to insert nil value
(key: gap)'
*** Call stack at first throw:
(
0 CoreFoundation 0x01961be9
__exceptionPreprocess + 185
1 libobjc.A.dylib 0x01ab65c2
objc_exception_throw + 47
2 CoreFoundation 0x0191a628 +[NSException
raise:format:arguments:] + 136
3 CoreFoundation 0x0191a59a +[NSException
raise:format:] + 58
4 CoreFoundation 0x01960455 -[__NSCFDictionary
setObject:forKey:] + 293
5 DromeiOS 0x00024731 -[PhoneGapDelegate
deviceProperties] + 545
6 DromeiOS 0x00024cce -[PhoneGapDelegate
webViewDidFinishLoad:] + 222
7 DromeiOS 0x00002e73 -[AppDelegate
webViewDidFinishLoad:] + 227
8 CoreFoundation 0x018d267d __inv[Switching to
process 5765 thread 0x207]
oking___ + 29
9 CoreFoundation 0x018d2551 -[NSInvocation
invoke] + 145
10 CoreFoundation 0x01900258 -[NSInvocation
invokeWithTarget:] + 72
11 CoreFoundation 0x018d3404 ___forwarding___ +
1124
12 CoreFoundation 0x018d2f22
_CF_forwarding_prep_0 + 50
13 CoreFoundation 0x018d267d __invoking___ + 29
14 CoreFoundation 0x018d2551 -[NSInvocation
invoke] + 145
15 WebCore 0x022b8c30
_ZL20HandleDelegateSourcePv + 64
16 CoreFoundation 0x0194301f
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
17 CoreFoundation 0x018a128b
__CFRunLoopDoSources0 + 571
18 CoreFoundation 0x018a0786 __CFRunLoopRun +
470
19 CoreFoundation 0x018a0240
CFRunLoopRunSpecific + 208
20 CoreFoundation 0x018a0161 CFRunLoopRunInMode
+ 97
21 GraphicsServices 0x01664268 GSEventRunModal +
217
22 GraphicsServices 0x0166432d GSEventRun + 115
23 UIKit 0x0007c42e UIApplicationMain
+ 1160
24 DromeiOS 0x00002ac6 main + 134
25 DromeiOS 0x00002a35 start + 53
)
terminate called after throwing an instance of 'NSException'

Calgacus

unread,
Oct 13, 2011, 11:34:37 AM10/13/11
to phonegap
I also worry about the build process copying over the www folder into
my project, If I use the same folder to store my ownfiles then won't
my own index.html file get overwritten?

Calgacus

unread,
Oct 13, 2011, 12:07:32 PM10/13/11
to phonegap
about the www folder, I see the copy script now, so I changed my www
folder to be in that place instead of where I had it (...dev/myapp/
myapp/www) to (.../dev/myapp/www) so that's ok i guess but I still
cannot run my app in simulator or device. It seems to crash even
before finding my index.html file, is there some setting somewhere I
can check to see if it is looking in the right place for that?

Hugo

unread,
Oct 13, 2011, 12:12:21 PM10/13/11
to phon...@googlegroups.com
The framework search path should point to the directory that contains PhoneGap.framework. After a standard install the path should be  /Users/Shared/PhoneGap/

(In my case it was a custom location, because I had to rebuild phonegap to workaround another issue)
Message has been deleted

Calgacus

unread,
Oct 13, 2011, 12:37:50 PM10/13/11
to phonegap
Thats what i have.

On Oct 13, 12:12 pm, Hugo <hhar...@gmail.com> wrote:
> The framework search path should point to the directory that contains
> PhoneGap.framework. After a standard install the path should be  *
> /Users/Shared/PhoneGap/*

Calgacus

unread,
Oct 13, 2011, 1:00:58 PM10/13/11
to phonegap
I made a new project with ARC turned off and I still get the exact
same crash, this with just the new project default index.html file -
none of my own code involved at all.


On Oct 13, 12:33 pm, Calgacus <coryd...@gmail.com> wrote:
> diggin a bit deeper I see that the argv in main.m contains *argv        char
> *       0xbfffee1c /Users/corytaylor/Library/ApplicationSupport/
> Iphonesimulator.4.2/Applications/C9E4AC93-BDD6-4AFD-8
> but the full folder name is C9E4AC93-BDD6-4AFD-8837-BA018DBE4CF2, so
> could xcode be  passing inthe wrong folder name?  or just truncating
> it in the watch list?
> Below that line the there is this:
> **argv  char    47 '/'
>
> When I create a new phonegap app should I use automatic reference
> counting or uncheck that option on project creation?

Calgacus

unread,
Oct 13, 2011, 1:56:04 PM10/13/11
to phonegap
diggin a bit deeper I see that the argv in main.m contains
*argv char
* 0xbfffee1c /Users/myname/Library/ApplicationSupport/
Iphonesimulator.4.2/Applications/C9E4AC93-BDD6-4AFD-8
but the full folder name is C9E4AC93-BDD6-4AFD-8837-BA018DBE4CF2, so
could xcode be passing inthe wrong folder name? or just truncating
it in the watch list?
Below that line the there is this:
**argv char 47 '/'

When I create a new phonegap app should I use automatic reference
counting or uncheck that option on project creation?

Calgacus

unread,
Oct 13, 2011, 3:47:41 PM10/13/11
to phonegap
I changed my from /Users/Shared/PhoneGap/Frameworks to /Users/Shared/
xxPhoneGap/Frameworks just to see what happens and i get the same
error, enven if i have nothing there i get the same error. I gotta
think that the system is not finding my PhoneGap framework.

Calgacus

unread,
Oct 14, 2011, 8:55:52 AM10/14/11
to phonegap
OK, here's what I seem to have to do: make a new project WITH A
DIFFERENT NAME than my project. even if I delete the old project
files and directories whenI create a new project by the same name I
get this crash. By changing the name it seems to work. So where is
the reference to the project saved on disk if not in my dev folder?
it still gotta be somewhere for this sort of conflict to happen
doesn't it?

Shazron

unread,
Jul 31, 2012, 2:17:33 PM7/31/12
to phon...@googlegroups.com
Thanks for the report. Filed: https://issues.apache.org/jira/browse/CB-1166

On Tue, Jul 31, 2012 at 9:13 AM, Martin Knechtel <knec...@gmail.com> wrote:
> I also had the error message
>
> "Terminating app due to uncaught exception 'NSInvalidArgumentException',
> reason: '-[__NSCFDictionary setObject:forKey:]: attempt to insert nil value
> (key: gap)'"
>
> with PhoneGap 1.4.1 on my console. The reason in my case was that I did not
> inlucude the file named VERSION in the project.
>
> --
> -- 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
>
>
Reply all
Reply to author
Forward
0 new messages