Embedded Binary Validation Utility Error
Asked Answered
H

9

17

Since yesterday Xcode is doing stupid things while trying to run my WatchKit app on my iPhone. It gives me the error:

Embedded Binary Validation utility Error

Error: warning: Is a directory

It's not very helpful and it seems like it's complaining about provisioning profiles for my Watchkit Extension target. I think I set it up correctly by following this answer.

This is how I have set up my profiles. Three App IDs and six profiles (three for development and three for distribution).

Main app: enter image description here

WatchKit Extension: enter image description here

WatchKit Watch App: enter image description here

Haemocyte answered 13/4, 2015 at 17:14 Comment(3)
I'm also getting this error but only when archiving. It might have something to do with the three warnings just before ("warning: skipping copy phase strip, binary is code signed" x 3).Copland
Ok my previous warnings aren't the issue, fixed them and it still fails on Warning: Is a directory.Copland
@JackDewhurst I had that warning too in first release. I fixed it but now the app doesn't archive (I'm able to run it on my iPhone sometimes too) but it's very frustrating.Haemocyte
C
8

I had my custom framework linked and embedded in both the WatchKit Extension and the App. Removing the framework from General > Embedded Binaries of the WatchKit Extension fixed it for me. I did have to delete my Build folder and restart Xcode.

Commemorative answered 17/4, 2015 at 12:31 Comment(2)
Can you please elaborate? I only have my framework linked in the build phases of my extensions.Haemocyte
Check General > Embedded Binaries of the WatchKit Extension. Your framework shouldn't be in there.Commemorative
E
5

I have been able to resolve the issue with the correct Provisioning Profiles setup.

With Xcode 6.2 I have been able to do a development/debug build with automatic set and no extra PPs for development in the portal, but using team provisioning.
Now with Xcode 6.3 I had to add 3 explicit PPs for development in the portal and assign them in the project settings.

Eddo answered 15/4, 2015 at 14:50 Comment(5)
I created the three different App IDs. Do I need to create two or three provisioning profiles?Haemocyte
Three, one for each AppId. Or in fact six, one for development one for archiving. See my answer in the linked SO question (or here: #28816839 )Eddo
See my updated question. I have followed you answer on that question already but still the same issue.Haemocyte
Did you also renew your PPs as mentioned? If that doesn't help, I'm sorry, but then you probably have another issue as I did.Eddo
Yes, deleted and recreated multiple times.Haemocyte
C
5

I've been fighting this error as well. For me, sometimes it builds, sometimes it doesn't. This is how I'm currently able to archive my WatchKit app. I'm not claiming any knowledge as to why this works, just that it works for me.

  1. Clean Shift-Command-K
  2. Quit Xcode
  3. Delete files in ~Library/Developer/Xcode/Derived Data
  4. Reopen Xcode and Archive
Colonialism answered 27/4, 2015 at 13:43 Comment(3)
That's some crazy voodoo but it worked for me. Apple Watch sure has made things difficult. lolLozier
Ok, so it happened again to me and I think I figured out why. Using git I switched to another branch that didn't have 6.3 support so I had to use 6.2. When I switched back to 6.3 it happened to me again.Lozier
In my case, just restarting Xcode fixes the problem. Weird.Chaing
R
3

For me the only way to fix this was to remove all spaces from schema name and watch app name.

To change schema name: (eg schema is "amazingapp RC")

1) Click on schema in xCode (It is where you choose device/simulator)
2) From the list choose: "edit schema"
3) When the new modal open press "duplicate schema" in left bottom corner.
4) Choose proper name without whitespaces and save.
5) Now press manage schemes and select old one.
6) Remove it by pressing "-" button

Now it is time for extension name:

1) Click on schema in xCode (It is where you choose device/simulator)
2) Choose extension schema
3) Click "edit schema"
4) Choose Archive (release) at the bottom of the left section
5) Enter a proper name without spaces in "Archive Name"
6) Close.

Now build->clean, build->archive and you should be good to go.

Reify answered 25/5, 2015 at 20:54 Comment(0)
C
2

UPDATE: I've been having this issue on another project and managed to solve it by removing spaces in my WatchKit App and Extension target names. So before my target names were APPNAME WatchKit App and APPNAME WatchKit Extension changing them to APPNAMEWatchKitApp and APPNAMEWatchKitExtension Fixed everything!

ORIGINAL: Just to add my two cents I've been struggling with this issue for a few weeks now. I've narrowed it down to including CocoaPods in the project but without a more descriptive error I've got no idea why.

I know my provisioning profiles are correct as a blank project (inc a WatchKit target) archives successfully with them. There are no static libraries in my WatchKit extension so that's not the problem either..

In the end the only thing that reliably works is using xcodebuild + xcrun in terminal to build and archive my project. This article explains xcode in the terminal well.

Copland answered 9/5, 2015 at 19:52 Comment(0)
I
1

I followed @dogsgod's suggestions, revoked all my certs etc. started over, 6 profiles, no luck. After doing this for almost 6 hours, another team member checked it out and it worked (letting xcode fix the issues for them). Making sure that groups were turned on for all the app id's (I am using groups to share data between watchkit and main app)

So, i thought it was just my xcode.

Then I went to git, cloned it, and then compiled it just fine.

Perhaps everything in my gitignore got rid of whatever files were blocking me. Or perhaps because i pulled it after they committed it. It's almost just voodoo at this point, but it worked

Innervate answered 17/4, 2015 at 16:20 Comment(0)
C
0

In my case it turned out to be my Xcode Preferences.

I had my DerivedData -> Advanced Settings (Build Location) set to "Custom" = "Relative to Workspace".

I changed it to Unique and that made it work.

Hopefully that helps someone.

Caoutchouc answered 2/7, 2015 at 20:3 Comment(0)
U
0

EDIT: A day later I can share one more thought. While the git cloning works, the problem resurfaces after I make some changes. Which makes me wonder if the problem comes from a bad file formatting (like non unix-like EOF or similar) or just a bug in Xcode. Anyways, my workflow currently is as follows:

1) git clone to another directory
2) archive
3) if there is an error, I need to fix it, 
4) git commit & git push
5) repeat steps 1 & 2 ... 

Which is bothersome, but it's the only way I can archive my project and actually upload it to the App Store...

ORIGNAL POST: I have encountered this error as well. My project uses CocoaPods, multiple targets and build schemes as well as group entitlements. At times I can't build, although this is fixable (see below) but the problem with archiving persited for a longer time. After two days of fighting with it, my summary is as follows:

I have followed all the responses and I can see that sometimes doing:

1) clean project

2) (optional - not alwys needed) restart Xcode

3) delete derived data folder contents

allows me to compile and run the App. But I still can't archive. Sometimes it seems that I have to do it twice.

Apart from the above, I have tried (and failed to archive) the following suggestions:

  • rename the target names (and containing folders) to NOT include whitespaces, the Extension and WatchApp targets doesn't have whitespaces in their respective names, but the project won't archive (no change)
  • I have checked that there's no embedded binaries in the Extension Target (watchApp don't have this option)
  • I have tried changing the deployment target (default was iOS 8.3 for Xcode 6.4) to both 8.2 and 8.4 with no luck in archiving.
  • I have recreated the AppIDs and all the provisioning profiles for both "adHoc" and "release schemas", no luck either.
  • and I have verified that the current schema I'm trying to archive doesn't have whitespaces, but it still doesn't change anything.
  • I have even tried the last suggestion, i.e. changing the default Derived Data folder location but, as I have suspected, it haven't changed anything.

Interestingly, what actually HAVE WORKED is the suggestion from Mike Manh: checking out the repo to another folder.

After cloning the repo to a new empty folder, everything suddenly started working. This leads me to the conclusion that there might be some leftover files/broken links/whatever in my current project folder. I guess this could've happen when I was trying to rebase my watchKit development branch into the current master branch. Which started trowing me some crazy conflicts and I have finally aborted the rebase. Possibly it was the point when the archive option ceased to function normally.

Underquote answered 18/8, 2015 at 9:34 Comment(0)
S
0

I had the same problem. In Xcode 6.* I fixed it by cleaning my DerivedData folder. But in new Xcode 7 it didn't help. So I removed spaces in WatchKit Extension and WatchKit App ("planckMailiOS WatchKit App" -> "planckMailiOSWatchKitApp" and "planckMailiOS WatchKit Extension" -> "planckMailiOSWatchKitExtension").

Scissile answered 20/9, 2015 at 20:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.