The main catalog of application assets currently copied

When I added the extension "Today", my application suddenly gained a lot of weight ... so I quickly checked where this fat comes from. It looks like .apex is 13 MB, the “Assets.car” file is even bigger than the one in my main application (+ 8 MB). The fact is that I use only 1 image in the asset catalog, which I have in my extension.

I checked inside Xcode, my main asset directory of the application does not switch to copying with the extension, but it seems like this is true.

This is normal? Do you know what to do to reduce the final size of .apex?

Thanks!

+7
ios objective-c today-extension
source share
1 answer

Do you accidentally use Cocoapods ?

There is currently an open problem that causes Copy Pods Resources to run a script to find all the assets and compile them into a large archive, which may be undesirable for all purposes.

Until this is fixed, a simple solution is to add post_install to your Podfile :

 # Fix broken copy-resources phase per https://github.com/CocoaPods/CocoaPods/issues/1546. post_install do |installer| installer.project.targets.each do |target| scriptBaseName = "\"Pods/Target Support Files/#{target.name}/#{target.name}-resources\"" sh = (<<-EOT) if [ -f #{scriptBaseName}.sh ]; then if [ ! -f #{scriptBaseName}.sh.bak ]; then cp #{scriptBaseName}.sh #{scriptBaseName}.sh.bak; fi; sed '/WRAPPER_EXTENSION/,/fi\\n/d' #{scriptBaseName}.sh > #{scriptBaseName}.sh.temp; sed '/*.xcassets)/,/;;/d' #{scriptBaseName}.sh.temp > #{scriptBaseName}.sh; rm #{scriptBaseName}.sh.temp; fi; EOT `#{sh}` end end 

The credit for the code snippet above applies to all the helpful people in the stream of problems!

+3
source share

All Articles