Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets NOT recompiled because Xcode skip run Copy Pod Resources #7745

Open
Whirlwind opened this issue May 15, 2018 · 10 comments
Open

Assets NOT recompiled because Xcode skip run Copy Pod Resources #7745

Whirlwind opened this issue May 15, 2018 · 10 comments
Labels
d3:hard An issue that is difficult to solve and may require significant changes t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Milestone

Comments

@Whirlwind
Copy link
Contributor

CP add some Input Files and Output Files to Copy Pod Resources in Build Phases. And Xcode will not run again if the Input Files and Output Files not be changed, include their contents are not changed. It is good job.

But, there are a logic which search assets will not be run again in the Copy Pod Resources script:

  OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
  while read line; do
    if [[ $line != "${PODS_ROOT}*" ]]; then
      XCASSET_FILES+=("$line")
    fi

There is a strange logic in the CP:
CP find all assets in my project directory, then run actool to compile my project's assets and Pod's assets together. actool will generate a Assets.car in xxx.app, and instead of origin Assets.car which be generated by Xcode.

eg:

My Projects: Assets.xcassets and IM.xcassets
Pods: ShareSDK.xcassets

Xcode will compile Assets.xcassets and IM.xcassets to Assets.car first. but it is a small file.
The Pod will recompile Assets.xcassets, IM.xcassets and ShareSDK.xcassets to a bigger Assets.car to instead of the small one.

It is OK, if there is NOT the Input Files and Output Files....

When the Input Files and Output Files not be changed, Xcode will skip the script.
If I update the Assets.xcassets, the Xcode will recompile the Assets.xcassets and IM.xcassets to a small Assets.car to overwrite the bigger which generated by Pods. But the Pod will not run the script again. So I will lose the ShareSDK.xcassets in my Assets.car.

I think the assets logic should be a Independent script.

Could you understand what I said?

@dnkoutso
Copy link
Contributor

Could you understand what I said?

Kind of...I can see a problem potentially but would like to see a sample app here demonstrating the issue 100%.

@dnkoutso dnkoutso added s1:awaiting input Waiting for input from the original author s6:need sample Needs a sample project that reproduces the issue labels May 18, 2018
@stale stale bot removed the s1:awaiting input Waiting for input from the original author label May 18, 2018
@dnkoutso dnkoutso added the s1:awaiting input Waiting for input from the original author label May 18, 2018
@Whirlwind
Copy link
Contributor Author

Whirlwind commented May 21, 2018

The Demo is very easy: https://github.com/Whirlwind/CocoaPodsTestAssets
First, build and run the MyApp, you will see a imageview in simulator. Then, please add any image to the Assets.xcassets in the MyApp. Run again, you will lost the image in the imageView!

@stale stale bot removed the s1:awaiting input Waiting for input from the original author label May 21, 2018
@Whirlwind
Copy link
Contributor Author

Test by Cocoapods v1.5.2

@dnkoutso dnkoutso added t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome! d3:hard An issue that is difficult to solve and may require significant changes and removed s6:need sample Needs a sample project that reproduces the issue labels May 25, 2018
@dnkoutso
Copy link
Contributor

dnkoutso commented May 25, 2018

definitely a bug. investigated will be a bit tough to fix. See more here #7779 (comment)

@MMMMiller
Copy link

I meet this issue too, with envi:

  • cocoapods 1.6.0 beta1
  • xcode 10 release
    did it resolved?

@Fab1n
Copy link

Fab1n commented Sep 28, 2018

@dnkoutso I experienced the same issue with a fresh project now and Xcode 10 when creating a sample project for #8136.

For everyone who is curious of how to reproduce the issue, I have setup a detailed sample project here:
https://github.com/Fab1n/PodResourcesBug

The sample project actually shows 2 recent issues regarding asset catalog compilation.
For this issue here you will need to check out the first bug.

The test procedure is written in detail in the repo's README.md

@songkaijia
Copy link

I meet this issue too, with envi:

cocoapods 1.1.1
xcode 10 release
did it resolved?

@dnkoutso
Copy link
Contributor

I have a fix for this.

@dnkoutso
Copy link
Contributor

@Whirlwind I have a fix on branch xcassets_revamp can you try it?

@dnkoutso
Copy link
Contributor

actually its not there yet.

@dnkoutso dnkoutso added this to the 1.14.0 milestone Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d3:hard An issue that is difficult to solve and may require significant changes t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Projects
None yet
Development

No branches or pull requests

5 participants