Error when build my project for iOS (Cannot read property 'indexOf' of null)

434 views
Skip to first unread message

Fellipe Henrique

unread,
Feb 29, 2016, 7:47:50 AM2/29/16
to phon...@googlegroups.com
Hi,

I have one project, and work fine until now... I just modified some HTML files, and try to build iOS running these command:

$ cordova build ios
Error: Cannot read property 'indexOf' of null

And show me these error!... I try to open the xcode project on xCode.. but when I compile, works fine, but doesn't get my last modified files...

Anyone know what's going on?

Regards.

T.·.F.·.A.·.     S+F
Fellipe Henrique P. Soares

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
Twitter: @fh_bash

jcesarmobile

unread,
Feb 29, 2016, 10:46:05 AM2/29/16
to phonegap
cordova CLI version?
cordova ios version of the project?

If you want to get the changes on the Xcode project you can use this command
cordova prepare ios

Fellipe Henrique

unread,
Feb 29, 2016, 11:07:51 AM2/29/16
to phon...@googlegroups.com
Cordova Cli: 6.0.0 (I use cordova -v, is correct?)

Cordova ios version: how can I see these?

Even cordova prepare io, and cordova build ios, same error.

$ cordova prepare ios
Error: Cannot read property 'indexOf' of null
T.·.F.·.A.·.     S+F
Fellipe Henrique P. Soares

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
Twitter: @fh_bash

--
-- 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
---
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/d/optout.

jcesarmobile

unread,
Feb 29, 2016, 12:33:30 PM2/29/16
to phonegap
You can see the cordova ios version with
cordova platform list

The node and npm versions might be helpfull too

Fellipe Henrique

unread,
Feb 29, 2016, 1:34:14 PM2/29/16
to phon...@googlegroups.com
There's all I can get from these command:

$ cordova platform list
Installed platforms: android 4.1.1, browser 4.0.0, ios 3.9.2
Available platforms: amazon-fireos, blackberry10, firefoxos, osx, webos

jcesarmobile

unread,
Feb 29, 2016, 1:58:04 PM2/29/16
to phonegap
can you check the node and npm versions?

Fellipe Henrique

unread,
Feb 29, 2016, 2:06:08 PM2/29/16
to phon...@googlegroups.com
$ node -v
v5.7.0

$ npm -v
3.6.0


I`m using MacOS El Capitan.. all updated (SO, xCode...)

T.·.F.·.A.·.     S+F
Fellipe Henrique P. Soares

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
Twitter: @fh_bash

Kerri Shotts

unread,
Feb 29, 2016, 2:35:39 PM2/29/16
to phonegap
Can you post the full error message (including stack trace)? Surely there's more to it than just one line.

jcesarmobile

unread,
Feb 29, 2016, 4:55:13 PM2/29/16
to phonegap
node 4 is recommended, but I think you should report this issue on http://issues.cordova.io

Fellipe Henrique

unread,
Mar 1, 2016, 7:09:46 AM3/1/16
to phon...@googlegroups.com

On Mon, Feb 29, 2016 at 4:35 PM, Kerri Shotts <kerri...@gmail.com> wrote:
Can you post the full error message (including stack trace)? Surely there's more to it than just one line.

Here is:

$ cordova prepare ios --verbose
Executing "before_prepare"  hook for all plugins.
Searching PlatformJson files for differences between project vs. platform installed plugins
No differences found between project and ios platform. Continuing...
Generating config.xml from defaults for platform "ios"
Error: TypeError: Cannot read property 'indexOf' of null
    at parseWhitelistUrlForATS (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/ios_parser.js:402:26)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/ios_parser.js:354:19
    at Array.reduce (native)
    at processAccessAndAllowNavigationEntries (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/ios_parser.js:353:6)
    at writeATSEntries (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/ios_parser.js:442:14)
    at ios_parser.update_from_config (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/ios_parser.js:114:15)
    at ios_parser.update_project (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/ios_parser.js:290:17)
    at PlatformApiPoly.prepare (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/PlatformApiPoly.js:212:25)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:101:32
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)


I also try to update my node using these commands:
brew update
brew upgrade node
npm install -g npm
Same error...

Kerri Shotts

unread,
Mar 1, 2016, 3:12:18 PM3/1/16
to phonegap
The error message indicates a problem parsing the whitelist. It could be a bug in Cordova, OR it could be an issue with your config.xml. Please post your entire config.xml so we can take a look.


On Tuesday, March 1, 2016 at 6:09:46 AM UTC-6, Fellipe Henrique wrote:
Error: TypeError: Cannot read property 'indexOf' of null
    at parseWhitelistUrlForATS (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/ios_parser.js:402:26)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/ios_parser.js:354:19
    at Array.reduce (native)
...

Fellipe Henrique

unread,
Mar 2, 2016, 7:56:25 AM3/2/16
to phon...@googlegroups.com
Hi Kerri,

Thanks so much for your help...


The error message indicates a problem parsing the whitelist. It could be a bug in Cordova, OR it could be an issue with your config.xml. Please post your entire config.xml so we can take a look.

Here is my config.xml : http://pastebin.com/A9XqL5ed

As I said.. works to prepare and compile for Android... but these error appears when I try to prepare for iOS....

regards..

Jgd Dgg

unread,
Apr 25, 2016, 10:35:39 AM4/25/16
to phonegap
Hello , have you solved this problem ?
because i have this problem now !

Kerri Shotts

unread,
Apr 25, 2016, 12:08:24 PM4/25/16
to phonegap
Post your entire config.xml file so we can help diagnose.
Reply all
Reply to author
Forward
0 new messages