rnpm / rnpm-plugin-upgrade

rnpm upgrade
Other
18 stars 1 forks source link

TypeError: buildSettings[OTHER_LDFLAGS].filter is not a function #1

Open vanBrunneren opened 8 years ago

vanBrunneren commented 8 years ago

when I try to run your plugin to upgrade from 0.25.1 to 0.26.0 i get the following error:

/MyApp/node_modules/rnpm-plugin-upgrade/node_modules/xcode/lib/pbxProject.js:1240
            var matches = buildSettings[OTHER_LDFLAGS].filter(function (p) {
                                                       ^

TypeError: buildSettings[OTHER_LDFLAGS].filter is not a function
    at pbxProject.removeFromOtherLinkerFlags (/MyApp/node_modules/rnpm-plugin-upgrade/node_modules/xcode/lib/pbxProject.js:1240:56)
    at upgradeIOSProject (/MyApp/node_modules/rnpm-plugin-upgrade/src/upgrade.js:12:11)
    at Object.upgrade [as func] (/MyApp/node_modules/rnpm-plugin-upgrade/src/upgrade.js:36:5)
    at Command.runAction (/.nvm/versions/node/v5.9.0/lib/node_modules/rnpm/bin/cli:21:15)
    at Command.listener (/.nvm/versions/node/v5.9.0/lib/node_modules/rnpm/node_modules/commander/index.js:301:8)
    at emitTwo (events.js:100:13)
    at Command.emit (events.js:185:7)
    at Command.parseArgs (/.nvm/versions/node/v5.9.0/lib/node_modules/rnpm/node_modules/commander/index.js:615:12)
    at Command.parse (/.nvm/versions/node/v5.9.0/lib/node_modules/rnpm/node_modules/commander/index.js:458:21)
    at Object.<anonymous> (/.nvm/versions/node/v5.9.0/lib/node_modules/rnpm/bin/cli:27:5)

do you have any idea how to fix this issue or am I doing something the wrong way?

grabbou commented 8 years ago

Interesting! It's an issue with the xcode parser we are using. In the meantime, I'd suggest adding flags manually. Can you drop me your project.pbxproj to my email (it's inside xcodeproj file, you can cd from command line into it)? We'll try to check what's going on.

PS. If you need assistance with upgrading, please ping me on Discord in #rnpm channel :)

stereodenis commented 8 years ago

have the same issue

pmadruga commented 8 years ago

Same issue here.

jrnk commented 8 years ago

Search your project.pbxproj for OTHER_LDFLAGS (it's in it multiple times) and make sure it's an array instead of just a string. So

OTHER_LDFLAGS = "-ObjC";

to

OTHER_LDFLAGS = (
                    "-ObjC",
                    "-lc++",
                );
Kureev commented 8 years ago

I think we need to move this issue to react-native. @grabbou, wdyt?