Strange Xcode 9 issue , Can't add an app icon - ios

Whenever I add an app Icon to Asset Catalog and run on Device , it gives following error. This happens with every single project even, blank new projects.
Asset Catalog Compiler Error /Users/****/Documents/Test/sfdadfas/sfdadfas/Assets.xcassets:
Failed to write image data for the app icon set from
"AppIcon.appiconset/app-icon-iphone#2x.png" to
"/Users/*****/Library/Developer/Xcode/DerivedData/sfdadfas-cbhytlfzznzesdsfsgifiloaxklokg/Build/Products/Debug-iphoneos/sfdadfas.app/AppIcon60x60#2x.png".
But when I run on Simulator , this works fine and app icon is visible correctly.
I'm using Xcode 9.2 (9.1 had the same error) on macOS High Sierra.
Xcode 8.3.3 doesn't have this issue.
EDIT
Full Error on log,
CompileAssetCatalog
/Users//Library/Developer/Xcode/DerivedData/sfdadfas-cbhytlfzznzevlegifiloaxklokg/Build/Intermediates.noindex/ArchiveIntermediates/sfdadfas/InstallationBuildProductsLocation/Applications/sfdadfas.app
sfdadfas/Assets.xcassets
cd /Users/****/Documents/Test/sfdadfas
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/****/Library/Developer/Xcode/DerivedData/sfdadfas-cbhytlfzznzevlegifiloaxklokg/Build/Intermediates.noindex/ArchiveIntermediates/sfdadfas/IntermediateBuildFilesPath/sfdadfas.build/Release-iphoneos/sfdadfas.build/assetcatalog_dependencies
--output-partial-info-plist /Users/****/Library/Developer/Xcode/DerivedData/sfdadfas-cbhytlfzznzevlegifiloaxklokg/Build/Intermediates.noindex/ArchiveIntermediates/sfdadfas/IntermediateBuildFilesPath/sfdadfas.build/Release-iphoneos/sfdadfas.build/assetcatalog_generated_info.plist
--app-icon AppIcon --compress-pngs --enable-on-demand-resources YES --sticker-pack-identifier-prefix com.*****.test22.sfdadfas.sticker-pack. --target-device iphone
--target-device ipad --minimum-deployment-target 10.3 --platform iphoneos --product-type com.apple.product-type.application --compile
/Users/****/Library/Developer/Xcode/DerivedData/sfdadfas-cbhytlfzznzevlegifiloaxklokg/Build/Intermediates.noindex/ArchiveIntermediates/sfdadfas/InstallationBuildProductsLocation/Applications/sfdadfas.app
/Users/****/Documents/Test/sfdadfas/sfdadfas/Assets.xcassets
/* com.apple.actool.errors */
/Users/****/Documents/Test/sfdadfas/sfdadfas/Assets.xcassets: error:
Failed to write image data for the app icon set from
"AppIcon.appiconset/app-icon-iphone#2x.png" to
"/Users/****/Library/Developer/Xcode/DerivedData/sfdadfas-cbhytlfzznzevlegifiloaxklokg/Build/Intermediates.noindex/ArchiveIntermediates/sfdadfas/InstallationBuildProductsLocation/Applications/sfdadfas.app/AppIcon60x60#2x.png".
Underlying Errors:
Description: pngcrush exited with signal '6' for "/Users/****/Documents/Test/sfdadfas/sfdadfas/Assets.xcassets/AppIcon.appiconset/app-icon-iphone#2x.png".
Error output:
In /Users/****/Documents/Test/sfdadfas/sfdadfas/Assets.xcassets/AppIcon.appiconset/app-icon-iphone#2x.png,
correcting libpng error: Too many IDAT's found
/* com.apple.actool.compilation-results */
/Users/****/Library/Developer/Xcode/DerivedData/sfdadfas-cbhytlfzznzevlegifiloaxklokg/Build/Intermediates.noindex/ArchiveIntermediates/sfdadfas/InstallationBuildProductsLocation/Applications/sfdadfas.app/Assets.car
/Users/****/Library/Developer/Xcode/DerivedData/sfdadfas-cbhytlfzznzevlegifiloaxklokg/Build/Intermediates.noindex/ArchiveIntermediates/sfdadfas/IntermediateBuildFilesPath/sfdadfas.build/Release-iphoneos/sfdadfas.build/assetcatalog_generated_info.plist

Related

Xamarin on VS for Mac - iOS Build Fails resource-rules has been deprecated in Mac OS X >= 10.10! or invalid resource specification rule(s)

I'm trying to build my Xamarin iOS app on Mac and failing on an error related to a deprecated command line parameter.
I tried targeting iphone 10, 11 and above but still failing on same error.
I Updated NuGets to latest versions, also tried creating an empty ResourceRules.plist file.
Xcode 12.1 (17222)
Build 12A7403
=== Xamarin.Mac ===
Version: 6.22.1.26 (Visual Studio Community)
=== Xamarin.iOS ===
Version: 14.4.1.3 (Visual Studio Community)
=== Operating System ===
Mac OS X 10.15.7
Build Command from log:
Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution started with arguments: --errors --warnings --notices --output-format xml1 --output-partial-info-plist /Users/user182752/Downloads/App1/App1.iOS/obj/iPhone/Release/actool/partial-info.plist --app-icon AppIcon --compress-pngs --target-device iphone --target-device ipad --minimum-deployment-target 11.0 --platform iphoneos --compile /Users/user182752/Downloads/App1/App1.iOS/obj/iPhone/Release/actool/bundle /Users/user182752/Downloads/App1/App1.iOS/obj/iPhone/Release/actool/cloned-assets/Assets.xcassets
...
...
Copied /Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/obj/iPhone/Release/mtouch-cache/arm64/Plugin.Settings.aotdata.arm64 to /Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/bin/iPhone/Release/MyDemoApp.iOS.app/Plugin.Settings.aotdata.arm64
/Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/bin/iPhone/Release/MyDemoApp.iOS.app built successfully.
Creating "bin/iPhone/Release/mtouch.stamp" because "AlwaysCreate" was specified.
Target _CopyITunesArtwork:
Copying file from "/Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/iTunesArtwork#2x" to "/Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/bin/iPhone/Release/iTunesArtwork#2x".
Target _CopyITunesArtwork:
Copying file from "/Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/iTunesArtwork" to "/Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/bin/iPhone/Release/iTunesArtwork".
Target _CopyAppExtensionsToBundle:
Skipping target "_CopyAppExtensionsToBundle" because it has no inputs.
Target _GenerateAppExtensionDebugSymbols:
Directory "bin/iPhone/Release/MyDemoApp.iOS.app/../.dSYM" doesn't exist. Skipping.
Target _CollectFrameworks:
No Frameworks directory found.
Target _GenerateFrameworkDebugSymbols:
Skipping target "_GenerateFrameworkDebugSymbols" because it has no inputs.
Target _GenerateDebugSymbols:
Directory "bin/iPhone/Release/MyDemoApp.iOS.app.dSYM" doesn't exist. Skipping.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil -num-threads 4 -z -o bin/iPhone/Release/MyDemoApp.iOS.app.dSYM bin/iPhone/Release/MyDemoApp.iOS.app/MyDemoApp.iOS
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -i -s obj/iPhone/Release/mtouch-symbols.list bin/iPhone/Release/MyDemoApp.iOS.app/MyDemoApp.iOS
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: warning: removing global symbols from a final linked no longer supported. Use -exported_symbols_list at link time when building: /Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/bin/iPhone/Release/MyDemoApp.iOS.app/MyDemoApp.iOS
Touching "bin/iPhone/Release/MyDemoApp.iOS.app.dSYM/Contents/Info.plist".
/usr/bin/mdimport bin/iPhone/Release/MyDemoApp.iOS.app/../
Target _CodesignAppBundle:
Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign 5FC337A423A139F99B2D118EC7FA72D8D0D94ABE --resource-rules /Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/bin/iPhone/Release/MyDemoApp.iOS.app/ResourceRules.plist --entitlements /Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/obj/iPhone/Release/Entitlements.xcent /Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/bin/iPhone/Release/MyDemoApp.iOS.app
bin/iPhone/Release/MyDemoApp.iOS.app : error : Warning: --resource-rules has been deprecated in Mac OS X >= 10.10!
bin/iPhone/Release/MyDemoApp.iOS.app : error : /Users/user182752/Downloads/MyDemoApp/MyDemoApp.iOS/bin/iPhone/Release/MyDemoApp.iOS.app: invalid resource specification rule(s)
Done building target "_CodesignAppBundle" in project "MyDemoApp.iOS.csproj" -- FAILED.
I saw some references to this error mainly in old posts referring to code signing but couldn't find a recent solution referring to Xamarin.
Any help would be appreciated.
Cheers,
Yuval

Ionic Capacitor can no longer produce a buildable iOS project, CompileAssetCatalog error

Having intractable build issues with Ionic 6.5.0 / Capacitor 2.2.0
I made the app not long ago, but today it won't build. After much fruitless updating/cleaning/building I deleted the ios directory and re-added it.
ionic cap add ios
ionic cap sync
Updated, removed DerivedData, clean build, same error:
CompileAssetCatalog /Users/me/Library/Developer/Xcode/DerivedData/App-ayobzjywexbfvjdrynzhsnownnyr/Build/Products/Debug-iphoneos/App.app /Users/me/Projects//MyProject/ios/App/App/Assets.xcassets (in target 'App' from project 'App')
cd /Users/me/Projects//MyProject/ios/App
/Applications/Xcode.app/Contents/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/me/Library/Developer/Xcode/DerivedData/App-ayobzjywexbfvjdrynzhsnownnyr/Build/Intermediates.noindex/App.build/Debug-iphoneos/App.build/assetcatalog_dependencies --output-partial-info-plist /Users/me/Library/Developer/Xcode/DerivedData/App-ayobzjywexbfvjdrynzhsnownnyr/Build/Intermediates.noindex/App.build/Debug-iphoneos/App.build/assetcatalog_generated_info.plist --app-icon AppIcon --compress-pngs --enable-on-demand-resources YES --filter-for-device-model iPhone10,1 --filter-for-device-os-version 13.5.1 --sticker-pack-identifier-prefix com.prosc.itineris.sticker-pack. --development-region en --target-device iphone --target-device ipad --minimum-deployment-target 11.0 --platform iphoneos --product-type com.apple.product-type.application --compile /Users/me/Library/Developer/Xcode/DerivedData/App-ayobzjywexbfvjdrynzhsnownnyr/Build/Products/Debug-iphoneos/App.app /Users/me/Projects//MyProject/ios/App/App/Assets.xcassets
2020-06-15 15:40:01.929 ibtoold[73405:1839106] DEBUG: Added to environment: {
TMPDIR = "/var/folders/g8/hc3lzhqn75d1ms9dzt46s7nw0000gn/T/E2DC0A8E-13DD-4566-A0E9-59C812831E2A";
}
Command CompileAssetCatalog failed with a nonzero exit code
If I run this command from the terminal it appears to exit with a 255 status, no errors/warnings/notices.
I tried the recommended updates in XCode, but I'm seeing some errors in the Xcode prior to the failure:
/Users/me/Projects/MyProject/node_modules/#capacitor/ios/Capacitor/Capacitor/Plugins/Network/Reachability.swift:207:4: Unexpected version number in 'available' attribute for non-specific platform '*'
/Users/me/Projects/MyProject/node_modules/#capacitor/ios/Capacitor/Capacitor/Plugins/Permissions.swift:39:5: Switch covers known cases, but 'AVAuthorizationStatus' may have additional unknown values, possibly added in future versions
/Users/me/Projects/MyProject/node_modules/#capacitor/ios/Capacitor/Capacitor/CAPBridge.swift:375:29: Coercion of implicitly unwrappable value of type 'String?' to 'Any' does not unwrap optional
/Users/me/Projects/MyProject/node_modules/#capacitor/ios/Capacitor/Capacitor/CAPPlugin.m:6:17: Method definition for 'shouldOverrideLoad:' not found
I don't think these are causing the error, however. Any suggestions / insights?
The solution was to update XCode to 11.5 by installing a new build from the App Store. My version of XCode was not installed from the app store.
After updating the additional XCode tools, this updated actool from 11.2.1 to 11.5
This had nothing to do with Ionic/Capacitor, building a totally new native iOS app was exhibiting the same error.

Flutter.io (dart) app fails to launch on iOS simulator

I have up-to-date OSX Sierra, up-to-date XCode with applicable plugins, and an iPhone 6 simulator open and ready.
I have followed all the directions at https://flutter.io/setup-macos/#ios-setup.
When I "flutter run" from Terminal, the app fails to install on the simulator with message:
Could not build the application for the simulator.
Error launching application on iPhone 6.
Here is what Terminal said...
Launching lib/main.dart on iPhone 6 in debug mode...
Running pod install... 8.5s
Running Xcode build... 24.1s
Failed to build iOS app
Error output from Xcode build:
↳
2017-11-22 13:13:38.122 xcodebuild[47659:25935636] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-13510/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/Runtime/PBXTargetBuildContext.mm:757
Details: unexpected successful exit code from cancelled command <C0009:'CpResource app.flx':P12>
Object: <PBXTargetBuildContext: 0x7fccf1235200>
Method: -createCommandInvocationRecordFromInvocation:
Thread: <NSThread: 0x7fccf2847ea0>{number = 16, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **
The following build commands failed:
CopyPlistFile /Users/deborah/Desktop/chq_emulator/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist Runner/GoogleService-Info.plist
(1 failure)
Xcode's output:
↳
Build settings from command line:
ARCHS = x86_64
BUILD_DIR = /Users/deborah/Desktop/chq_emulator/build/ios
ONLY_ACTIVE_ARCH = YES
SDKROOT = iphonesimulator11.1
=== CLEAN TARGET leveldb-library OF PROJECT Pods WITH CONFIGURATION Debug ===
... list of subsidiary infomation ...
Could not build the application for the simulator.
Error launching application on iPhone 6.
Anyone else out there with advice for how to get Flutter going on the simulator?
Try running your Xcode first and make sure that it's up-to-date. Open the {flutter_project}/ios build on Xcode then try to run the iOS project on the Simulator from there.
If you're still having issues, you can run this command on your Terminal. This should set the path for the active developer directory.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

CompileXIB com.apple.InterfaceBuilder error 2001 operation couldn’t be completed

Compiled my project code and now I receive the following error on all XIB and Storyboard files. Can someone help me solve? All IB files point to the proper deployment target (9.0).
CompileXIB App/WelcomeScreenViewController.xib
cd /Users/jried31/Downloads/zzz/v6/App
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module App --output-partial-info-plist /Users/jried31/Library/Developer/Xcode/DerivedData/App-basveboargfgfwdisbiioebismye/Build/Intermediates/App.build/Debug-iphonesimulator/App.build/WelcomeScreenViewController-PartialInfo.plist --auto-activate-custom-fonts --target-device iphone --minimum-deployment-target 9.0 --output-format human-readable-text --compile /Users/jried31/Library/Developer/Xcode/DerivedData/App-basveboargfgfwdisbiioebismye/Build/Products/Debug-iphonesimulator/Alure.Me.app/WelcomeScreenViewController.nib /Users/jried31/Downloads/zzz/v6/App/App/WelcomeScreenViewController.xib
/* com.apple.ibtool.errors */
/Users/jried31/Downloads/zzz/v6/App/App/WelcomeScreenViewController.xib: error: The operation couldn’t be completed. (com.apple.InterfaceBuilder error 2001.)
In my case, a merge conflict caused the files to fail to compile, so I just had to open them up in a text editor and resolve the merge.
All the other solution did not work for me. I did not have a merge issue as I got the issue no matter which branch I was using.
In the end I redownloaded Xcode (7.3.1) and now it is working again.
Solved my own problem:
More Clarification of the issue was that all of the XIB's and Storyboard files would not compile, resulting in the 2001 error.
SOLUTION:
The problem was because the Simulator was based on iOS 9.1 and the build target for both the Podfile and iOS project was 9.0...That inconsistency caused issues. I resolved it by the following:
Product -> Clean
Product -> (hold down option) Clean build folders
Delete Derived Data (~/Library/Developer/Xcode/DerivedData)
Download the 9.0 simulator (if you choose to keep the project at 9.0 settings) resulting in two simulator builds (9.1 and 9.0)
Restart XCODE
--- Just make sure that all of your settings reflect the desired OS version you'd like to go with.

Error when building the project in Xcode

I get following error while building the project.
Clening also didn't help. No idea what went wrong all of a sudden
CompileAssetCatalog /Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Products/Debug-iphonesimulator/Pizza\ to\ Go.app Pizza\ to\ Go/Images.xcassets Pizza\ to\ Go/Images.xcassets
cd "/Users/Mayu/Documents/development/git/pizzatogo/iPhoneApp/Pizza to Go"
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Intermediates/Pizza\ to\ Go.build/Debug-iphonesimulator/Pizza\ to\ Go.build/assetcatalog_dependencies.txt --output-partial-info-plist /Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Intermediates/Pizza\ to\ Go.build/Debug-iphonesimulator/Pizza\ to\ Go.build/assetcatalog_generated_info.plist --app-icon AppIcon --launch-image LaunchImage --platform iphonesimulator --minimum-deployment-target 7.0 --target-device iphone --compress-pngs --compile /Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Products/Debug-iphonesimulator/Pizza\ to\ Go.app /Users/Mayu/Documents/development/git/pizzatogo/iPhoneApp/Pizza\ to\ Go/Pizza\ to\ Go/Images.xcassets /Users/Mayu/Documents/development/git/pizzatogo/iPhoneApp/Pizza\ to\ Go/Pizza\ to\ Go/Images.xcassets
/* com.apple.actool.errors */
: error: There are multiple app icon set instances named "AppIcon".
: error: There are multiple launch image set instances named "LaunchImage".
/* com.apple.actool.compilation-results */
/Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Products/Debug-iphonesimulator/Pizza to Go.app/Assets.car
/Users/Mayu/Library/Developer/Xcode/DerivedData/Pizza_to_Go-dohdzfdfbyycqrhirbysuinqfuzf/Build/Intermediates/Pizza to Go.build/Debug-iphonesimulator/Pizza to Go.build/assetcatalog_generated_info.plist
As this error says you have duplicated images AppIcon and LaunchImage. To sort it just make copy of it and remove it from your project (have a look in Images.xcassets and remove it as well). After that import it again to Images.xcassets.
For me, the problem was that I had my assets folder with multiple targets with while extensions already had those target assigned. Fix was to make sure each asset folder was only assigned to its specific target, or delete folders that are not needed.
Error: multiple instances of AppIcon (when working with Storyboard).
This solution worked for me:
Look in the Storyboard window's Navigation panel for a duplicate listing of Images.xcassets. If there, highlight it and press delete key. When asked, select “remove reference” - not send to trash (which might delete the actual Images.xcassets folder). Apparently this duplicate listing in the project can occur if an attempt is aborted to import something into Images.xcassetes.

Resources