Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
109 stars 139 forks source link

IOS build fails: Path must be a string. Received undefined #269

Closed androdel closed 6 years ago

androdel commented 6 years ago

Hi,

I'm using the latest version of the Pushwoosh plugin, but if I want to build on iOS I get this message: Path must be a string. Received undefined. Android app builds perfectly. Anybody got any idea?

Cordova @ 7.1.0 iOS @ 4.5.2

Kind regards

wfhm commented 6 years ago

Hi,

Could you please provide us with a bit more details on this issue? A full build log or some screenshots would be much appreciated.

mccraigmccraig commented 6 years ago

i had the exact same error message but with android@6.2.3 and android@6.3.0 rather than iOS

downgrading cordova to 7.0.1 and removing/re-adding the platforms and the pushwoosh-cordova-plugin solved it. the error only occurred with cordova-7.1.0 and pushwoosh-cordova-plugin - i tried both 7.0.4 and 7.0.7

i couldn't get any detailed error messages out of the cordova build - --stacktrace and --debug didn't seem to give any more detail

androdel commented 6 years ago

Yep, downgrading Cordova to 7.0.1 also did the trick for me. I’ve also tried previous releases of pushwoosh plugin but without success. It seems that is error is coming from Cordova but relates on something of the pushwoosh plugin. Maybe their release notes of version 7.1.0 can help figure out where the problem lies?

itpverde commented 6 years ago

Your propossed fix didn't work for me :(

I removed iOS platform, downgraded to Cordova 7.0.1, added iOS platform again and tried to build... build failed! This is my environment:

MacBook Pro, OS X (El Capitan) 10.11.6 node.js 8.7.0 npm 5.5.1 --> Cordova 7.0.1 platform: iOS 4.5.1 Pushwoosh plugin 7.0.7

Why is your fix (downgroading to Cordova 7.0.1) working for you but not for me? Of course, If I remove the Pushwoosh plugin I can build the app without problems.

Thanks in advance for your help. Regards from Spain,

Dani

mccraigmccraig commented 6 years ago

don't know @itpverde - i don't have any real insight into what is causing the error - i couldn't get any detailed error messages out of cordova

i had removed by node_modules, platforms and plugins directories and let prepare re-create them, but otherwise i have nothing to offer :(

itpverde commented 6 years ago

Finally worked by downgroading cordova to 7.0.1 [[AND ALSO Pushwoosh plugin to 7.0.6]].

Thanks for your help anyway. Regards,

Dani

shivan commented 6 years ago

Same problem here. Hopefully there will be an update for the pushwoosh plugin soon.

Using Cordova 7.1.0 npm 3.10.10 nodejs 6.11.0 xcode 9.0.1

cordova -d prepare ios
...
This app does not have icons defined
This app does not have splash screens defined
Updating launch storyboard images at platforms/ios/TestAppE/Images.xcassets/LaunchStoryboard.imageset/
Updating Storyboard image set contents.json
This app does not have additional resource files defined
Prepared iOS project successfully
Error: Path must be a string. Received undefined
wfhm commented 6 years ago

@itpverde pushwoosh-cordova-plugin@7.0.7 requires XCode 9, could it be the issue? Also, if you use Phonegap Build tool, you are not able to use @7.0.7, as Adobe have not yet updated XCode on their build servers.

wfhm commented 6 years ago

@shivan

Checking the issue with pushwoosh-cordova-plugin and Cordova 7.1.0. Will update shortly.

wfhm commented 6 years ago

@shivan We tried reproducing the issue with no luck - it builds and runs just fine with pushwoosh-cordova-plugin@7.0.8 and Cordova 7.1.0.

May I ask you to try our Sample app and let us know whether the issue is reproducible with it on your side?

robobobo commented 6 years ago

I seem to be having a similar issue, everything works fine until I add the pushwoosh plugin

`Installing "pushwoosh-cordova-plugin" for ios

Error: Path must be a string. Received undefined

[ERROR] Exception: `

I'm using the latest version of ionic/cordova etc..

`cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.16.0
ionic (Ionic CLI) : 3.16.0

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

@ionic/app-scripts : 3.0.1
Cordova Platforms  : ios 4.5.3
Ionic Framework    : ionic-angular 3.8.0

System:

ios-deploy : 1.9.2 
Node       : v6.11.2
npm        : 5.5.1 
OS         : macOS Sierra
Xcode      : Xcode 9.1 Build version 9B55 `

Everything works perfectly fine until I add the pushwoosh plugin the I get 'Error: Path must be a string. Received undefined' each time I try run 'ionic cordova build'

Strangely if I remove the pushwoosh plugin I'll continue to get the problem, I have to remove the iOS platform and start again to get things working

I'm going to experiment with an older version of pushwoosh and see if that has any affect

robobobo commented 6 years ago

Tried with pushwoosh version 6.5.3 which previously was working fine and got the same problem, something must not be playing right with the updated ionic/angular/cordova frameworks

robobobo commented 6 years ago

Ok another update, I just set up a new ionic app completely blank, installed pushwoosh plugin and it built the iOS platform without any problems! Will keep digging!

robobobo commented 6 years ago

So an update, it turns out this was nothing to do with Pushwoosh but the error was caused by some code in my 'config.xml' file

I had `

UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown
    </config-file>`

In my config.xml file and once I removed it this removed the error completely. Luckily this isn't something I need anymore as it's just a setting in Xcode, obviously support for it has been dropped!

Once I removed that code from my config.xml file, it all complied as expected

wfhm commented 6 years ago

@robobobo Thank you for letting us know!

pugwonk commented 6 years ago

I'm having this problem too (and I don't have anything odd looking in my config.xml). Cordova 7.1.0, XCode 9.2, pushwoosh-cordova-plugin 7.0.8.

Behavior is I think the same as @robobobo. Build fails with "Error: Path must be a string. Received undefined". If I run cordova platform rm ios and then cordova platform add ios, it gets as far as "Installing pushwoosh-cordova-plugin for ios" and then shows me that same error and stops. If I remove the ios platform, then run cordova plugin rm pushwoosh-cordova-plugin, then re-add the ios platform, it all works fine and the build runs. If I then run cordova plugin add pushwoosh-cordova-plugin, the plugin does seem to install okay but all my builds fail immediately with that error. Adding -d to the build command doesn't tell me anything enlightenning (the item immediately before the error is "Prepared iOS project successfully"). Again much like @robobobo (and somewhat mysteriously), if I then remove the pushwoosh plugin my builds continue to fail with the same error until I remove and re-add the ios platform again.

It definitely seems to be something that's caused/triggered by the Pushwoosh plugin, but the error also seems to live on after uninstalling it.

Edit: One other thing - this behaviour happens even if I go all the way back to version 6.5.3 of the plugin. So it does indeed seem to be related to changes in Cordova rather than changes in the plugin.

Edit: Downgrading Cordova to 7.0.1 fixes this.

wfhm commented 6 years ago

@pugwonk Could you please provide us with your build log? Also, may I ask you to try using pushwoosh-pgb-plugin instead of pushwoosh-cordova-plugin?

robobobo commented 6 years ago

After reading @pugwonk 's post that behaviour is exactly what was happening to me. It was the mysterious issue with builds failing even after the plugin was removed, and then sometimes the builds work would fine depending on the order I added the platform or plugin.

My conclusion of it being an issue with the config.xml file was probably more out of desperation than anything!

pugwonk commented 6 years ago

@wfhm I'm not using PhoneGap - should I still try using the pgb plugin?

wfhm commented 6 years ago

@pugwonk Sorry, I've re-read your previous message, and realized that it will not solve the issue, as it happens even with 6.5.3 version of the plugin.

We could not reproduce the issue on our side with Cordova 7.1.0 and XCode 9.2 yet. By any chance could you please provide us with your full build log?

jopache commented 6 years ago

We also had issues with this plugin and this error. Using Cordova 7.1.0 and Pushwoosh plugin 7.1.0 . it does not require a full build to recreate the issue. A simple Cordova prepare will make the issue come up.

wfhm commented 6 years ago

@androdel @mccraigmccraig @itpverde @shivan @robobobo @pugwonk @jopache

Guys, could you please let us know whether the issue persists with the latest version of the plugin?

shivan commented 6 years ago

Hi,

on our side it's now working after removing several settings in the config.

pugwonk commented 6 years ago

We're still seeing this in Cordova 7.1.0 and 8.

MatthewPringle commented 5 years ago

I have just seen this problem when adding camera plist settings to config.xml

Could this plugin be getting confused with other settings in the config.xml file, such as

<config-file target="*-Info.plist" parent="NSCameraUsageDescription"     <string>CAMERA_USAGE_DESCRIPTION</string>
</config-file>
ingageco commented 5 years ago

Still seeing this issue in pushwoosh latest (7.9.0) and cordova 8.0

narenderreddych commented 5 years ago

yes Still seeing this issue in pushwoosh latest (7.9.4) and Cordova 8.0 in iOS platform if we run the application through Xcode working fine but through CLI getting an error like "config file undefined requested changes not found a path(/Users/...../platforms.ios/undefined)..."