# iOS / Xcode Archive fails with: “Touch” and then “ARCHIVE FAILED”, but no other error in the log

**URL:** <https://discuss.bitrise.io/t/ios-xcode-archive-fails-with-touch-and-then-archive-failed-but-no-other-error-in-the-log/3992>\
**Category:** Builds\
**Created:** [February 1, 2018, 2:26pm UTC](https://discuss.bitrise.io/t/ios-xcode-archive-fails-with-touch-and-then-archive-failed-but-no-other-error-in-the-log/3992 "2018-02-01T14:26:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 1, 2018, 2:45pm UTC](https://discuss.bitrise.io/t/ios-xcode-archive-fails-with-touch-and-then-archive-failed-but-no-other-error-in-the-log/3992/2 "2018-02-01T14:45:55Z")

</div>

Thanks for filling out the whole report, it helped a lot!

Found the issue in the `raw-xcodebuild-output.log`. You can find this file on the build’s page, in the **Apps & Artifacts** section/tab:

 ![Screen_Shot_2018-02-01_at_15_35_58](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/5/5a147e9cbf168084d1f4ef04df4ac938e7ffe05b.png)

This error is one of the rare cases when the error is not at the end of the Xcode build log, but somewhere a bit above that. Around its end but like 100 lines before its end, that’s why you can’t see that in the [bitrise.io](http://bitrise.io) build log directly (usually the error is in the last couple of lines, so to not to make the build logs even more verbose we only print the last 10 lines in the Xcode Archive step).

Anyway, so in a case like yours, **when the [bitrise.io](http://bitrise.io) build log does not include the Xcode error**:

1. Go to the Build’s page
2. Into **Apps & Artifacts** section
3. Locate and download the `raw-xcodebuild-output.log` (if the file’s not there please make sure you have the **Deploy to [Bitrise.io](http://Bitrise.io)** step in the workflow, as that’s the step which attaches this file to the build → more info: [Xcode exit code 65 / exit code 66 / raw-xcodebuild-output.log - #2 by viktorbenei](http://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813/2) )
4. Then search for **`error:`** in the raw xcodebuild output log (e.g. with **`grep`** : `$ grep 'error:' ~/Downloads/raw-xcodebuild-output.log`)

In your case:

```auto
$ grep 'error:' ~/Downloads/raw-xcodebuild-output.log

While reading /Users/vagrant/git/ios/eyr/Images.xcassets/AppIcon.appiconset/AppIcon40@3x.png pngcrush caught libpng error:

```

The lines around this:

```auto
CopyPNGFile /Users/vagrant/Library/Developer/Xcode/DerivedData/eyr-aovrweneodzgtabgzxwvaqvvrcvp/Build/Intermediates.noindex/ArchiveIntermediates/eyr/InstallationBuildProductsLocation/Applications/eyr.app/AppIcon40@3x.png eyr/Images.xcassets/AppIcon.appiconset/AppIcon40@3x.png
    cd /Users/vagrant/git/ios
    export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/vagrant/.bitrise/tools:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin:/usr/local/opt/go/libexec/bin:/Users/vagrant/go/bin:/Users/vagrant/bitrise/tools/cmd-bridge/bin/osx:/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/tools:/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/tools/bin:/Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands"
    export TOOLCHAINS=
    /Applications/Xcode.app/Contents/Developer/usr/bin/copypng -compress -strip-PNG-text /Users/vagrant/git/ios/eyr/Images.xcassets/AppIcon.appiconset/AppIcon40@3x.png /Users/vagrant/Library/Developer/Xcode/DerivedData/eyr-aovrweneodzgtabgzxwvaqvvrcvp/Build/Intermediates.noindex/ArchiveIntermediates/eyr/InstallationBuildProductsLocation/Applications/eyr.app/AppIcon40@3x.png

While reading /Users/vagrant/git/ios/eyr/Images.xcassets/AppIcon.appiconset/AppIcon40@3x.png pngcrush caught libpng error:
   \2478p\247Zv\241\270\333\367\277\343v\241\374~\247\370u\2479

Command /Applications/Xcode.app/Contents/Developer/usr/bin/copypng emitted errors but did not return a nonzero exit code to indicate failure

```

This means that there’s some issue with that image. The most common issue is that the `.png` file is not a PNG file actually, e.g. it’s actually a JPG saved with `.png` extension (Xcode can’t handle this).

Fix the image, commit & push and it should be fine again 😉

If you’d have any questions just let us know!  
Happy Building! 🙂

---

_[View the full topic](https://discuss.bitrise.io/t/ios-xcode-archive-fails-with-touch-and-then-archive-failed-but-no-other-error-in-the-log/3992)._
