Cocoapods: Generated 'Copy Pods Resources' script contains invalid paths

Created on 28 Jan 2015  路  32Comments  路  Source: CocoaPods/CocoaPods

In CocoaPods 0.36.0.beta.2 there appears to be an issue related to the generation of the 'Copy Pods Resources' script.
Pods such as HockeySDK describing resource bundles cause the generated script Pods-resources.sh to contain statements such as the following:

if [[ "$CONFIGURATION" == "Debug" ]]; then
  install_resource '${BUILT_PRODUCTS_DIR}/HockeySDKResources.bundle'
fi

Due to the use of single quotes the script fails to expand the referenced environment variable and subsequently causes an error.

This appears to have been introduced in the following issue:
https://github.com/CocoaPods/CocoaPods/pull/3030/files#diff-81a515a6548afa6bb211544200a709edR79

Based on my current understanding reverting to using double quotes should suffice to resolve this issue.

-  script += "  install_resource '#{resource}'\n"
+  script += "  install_resource \"#{resource}\"\n"

Most helpful comment

I have this on 1.0.0 - pre 6

All 32 comments

@flufff42 please submit a pull request?

Using double quotes would cause resources with double quotes in the name to fail. I think we should instead properly escape these paths.

This also affects popular pods such as InAppSettingsKit or Appirater, so I guess many people will run into this.

@kylef That's a good point. I have attempted to address this case in my PR (#3085) however I am not sure if this is the optimal solution.

It seems that there are two cases where install_resource is used now, for individual resource files specified with resources and bundles as specified with resource_bundles which have ${BUILT_PRODUCTS_DIR} prepended.

It may be useful to amend https://github.com/CocoaPods/CocoaPods/blob/master/spec/unit/installer/target_installer/aggregate_target_installer_spec.rb#L145 however this would also require updating the Podspec fixture which I'm currently stuck on.

Experiencing a similar issue myself. rsync is failing with:

rsync: link_stat "/Users/administrator/Desktop/ios/Pods/${BUILT_PRODUCTS_DIR}/HockeySDKResources.bundle" failed: No such file or directory (2)

and a few lines down...

sent 1626812 bytes  received 684 bytes  1084997.33 bytes/sec
total size is 1624170  speedup is 1.00
rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(992) [sender=2.6.9]

I have to stick with 0.35.0 for now because of this.

Is there any stable solution?
Rolled back to CocoaPods 0.35.0 with:

[sudo] gem uninstall cocoapods

@k06a This is resolved in 0.36.0.rc.1. No need to roll back.

I'm on 0.36.0 and this is still an issue for me. The paths in the Pods-resources.sh file are not correct for the resource_bundles defined in the Podspec for the pod I'm using. The issue I am seeing is that the last directory is missing from the path. Here is what the end of the path should be:

../Build/Products/Debug-iphonesimulator/Pods/MyResource.bundle

but in Pods-resources.sh it is just this:

../Build/Products/Debug-iphonesimulator/MyResource.bundle

@jj0b Please update to 0.36.1 which has a workaround for this problem.

@kylef I just updated to 0.36.1, did pod install, deleted derived data, cleaned and then built, and still have this issue.

I've also updated to 0.36.1, but still isn't fixed :(

+1 still have this issue with 0.36.1

I also have this issue with 0.36.3.

I have the issue with 0.37.2

Same issue for me with 0.37.2

Still seeing this issue as well.

Can anyone confirm whether https://github.com/CocoaPods/CocoaPods/issues/3768 fixes the issue?

Appears fixed for me in 0.38.0

Upgrading from 0.37.2 to 0.38.2 fix this for me

I have tried both 0.38.2 And 0.39.0 b4 and it fails with both.

@nghtstr as this issue is closed and others say it is fixed for them, please verify whether https://github.com/CocoaPods/CocoaPods/issues/3768 fixes the issue for you?

@segiddins I have looked over that ticket, and I don't see what I am supposed to do with my Podfile that you are suggesting.

Still hitting this these days, anyone else?

I have this on 1.0.0 - pre 6

@nilsen340 Yes, I'm experiencing issues there as well. (1.0.0.pre.6)

Me too on on 1.0.0 - pre 6

I have this issue in 1.0.0 pre 6, but I don't have it in 0.39.0

Same here.

Having this issue for CTAssetsPickerController on 1.0.0.beta6

Since this issue is closed, please move discussion of this possible regression to https://github.com/CocoaPods/CocoaPods/issues/5082 instead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iosdev-republicofapps picture iosdev-republicofapps  路  3Comments

evermeer picture evermeer  路  3Comments

soleares picture soleares  路  3Comments

sonu5 picture sonu5  路  3Comments

pallaviMN picture pallaviMN  路  3Comments