x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Packaging for iOS fails with "Cannot create because a file with the same name already exists."

I recently have issues packaging for iOS (and tvOS) on Mac. I use UE4Editor/Mac/Development built from latest 4.11 branch to package my game for iOS/Development. All goes well except in the end I get a message that it Cannot create /Volumes/Dev/UnrealEngine/4.11/Projects/SkookumDemo/Binaries/IOS/Payload/SkookumDemo.app/SkookumDemo because a file with the same name already exists.. I checked and indeed there is a file already named like that (the executable). Any clues why this is happening?

Full log text below:

 MainFrameActions: Packaging (iOS): Project.Package: ********** PACKAGE COMMAND STARTED **********
 MainFrameActions: Packaging (iOS): IOSPlatform.Package: Package /Volumes/Dev/UnrealEngine/4.11/Projects/SkookumDemo/SkookumDemo.uproject
 MainFrameActions: Packaging (iOS): Getting IOS Deploy()
 MainFrameActions: Packaging (iOS): Program.Main: ERROR: AutomationTool terminated with exception: System.IO.IOException: Cannot create /Volumes/Dev/UnrealEngine/4.11/Projects/SkookumDemo/Binaries/IOS/Payload/SkookumDemo.app/SkookumDemo because a file with the same name already exists.
 MainFrameActions: Packaging (iOS):   at System.IO.Directory.CreateDirectory (System.String path) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at System.IO.DirectoryInfo.Create () [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:Create ()
 MainFrameActions: Packaging (iOS):   at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at System.IO.Directory.CreateDirectory (System.String path) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at System.IO.DirectoryInfo.Create () [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:Create ()
 MainFrameActions: Packaging (iOS):   at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at System.IO.Directory.CreateDirectory (System.String path) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at IOSPlatform.Package (AutomationTool.ProjectParams Params, DeploymentContext SC, Int32 WorkingCL) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at Project.Package (AutomationTool.ProjectParams Params, Int32 WorkingCL) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at BuildCookRun.DoBuildCookRun (AutomationTool.ProjectParams Params) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at BuildCookRun.ExecuteBuild () [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at AutomationTool.BuildCommand.Execute () [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at AutomationTool.Automation.Execute (System.Collections.Generic.List`1 CommandsToExecute, Tools.DotNETCommon.CaselessDictionary.CaselessDictionary`1 Commands) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at AutomationTool.Automation.Process (System.String[] CommandLine) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at AutomationTool.Program.MainProc (System.Object Param) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at AutomationTool.InternalUtils.RunSingleInstance (System.Func`2 Main, System.Object Param) [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS):   at AutomationTool.Program.Main () [0x00000] in <filename unknown>:0 
 MainFrameActions: Packaging (iOS): Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)
 MainFrameActions: Packaging (iOS): Domain_ProcessExit
 MainFrameActions: Packaging (iOS): RunUAT ERROR: AutomationTool was unable to run successfully.
Product Version: UE 4.11 Preview
Tags:
more ▼

asked Feb 05 '16 at 04:53 PM in Packaging & Deployment

avatar image

GreatGuru
120 10 12 20

avatar image Steve Hardister ♦♦ STAFF Feb 08 '16 at 05:56 PM

Hi GreatGuru,

You cannot have a directory with the same name as the executable. Change the name of one and retry. Let me know if this does not work for you.

-Steve H.

avatar image GreatGuru Feb 08 '16 at 06:49 PM

Hmm both the folder and the executable name come from the build process as far as I know, presumably both reflecting the project name, SkookumDemo. I did not choose these names. How do you suggest I go about changing them? I could try renaming the project see if that helps I guess.

avatar image Steve Hardister ♦♦ STAFF Feb 08 '16 at 09:18 PM

Using the project you sent, SkookumDemo 4.11 3, I was able to launch successfully to a folder on the Desktop called "TestPackage" for both Mac and iOS without issue. Please try this and/or renaming the project and let us know your results.

avatar image GreatGuru Feb 10 '16 at 09:35 PM

So - renaming the project file from to SkookumDemo.uproject to SkookumDemo2.uproject fixes the issue. I take it back, renaming the project file does not fix the issue. I renamed the project to all sorts of names, and just get the same message just with the word SkookumDemo replaced with the new project name. I am using UE4Editor on Mac and I "Package" for iOS.

avatar image GreatGuru Feb 11 '16 at 07:02 AM

Ok this looks like a bug related to the staging of additional NonUFS files. Seems like the folder hierarchy of staged files was changed between 4.10 and 4.11. You are not seeing the issue because you probably don't have SkookumScript installed and never generated SkookumScript binary files that are packaged with the excutable, exposing this problem. Try to reproduce this (on Mac):

  1. In the SkookumDemo project, verify that there is an entry in the Config/DefaultGame.ini file

     [/Script/UnrealEd.ProjectPackagingSettings]
        +DirectoriesToAlwaysCook=(Path="ScriptLoaded")
        +DirectoriesToAlwaysStageAsNonUFS=(Path="skookumscript")
    
    
  2. Now, in the project's Content folder, create a subfolder skookumscript, and inside that folder place a random file, e.g. a text file test.txt containing the string "Hello World".

  3. Try to package the project for iOS, see if you get my error. What should happen here is that the skookumscript folder with the test file will be placed in the staged package inside the cookeddata/content folder. Instead it creates a folder SkookumDemo/content right beside cookeddata and places the skookumscript folder there. This then causes the naming conflict with the executable.

Thanks!

avatar image Steve Hardister ♦♦ STAFF Feb 11 '16 at 03:37 PM

I cannot install SkookumScript... I get an error saying not compatible with this version of the Engine. I see the plugin is for UE4.11 preview 4, and everyone on the support team has updated to preview 5.

So do you have a preview 5 version of the plug-in available? If not, I may be able to find a workaround or someone who has not updated yet.

avatar image GreatGuru Feb 11 '16 at 03:53 PM

Have you tried the three steps above? They don't require SkookumScript and should still cause the error to occur. We will post a pre-built plugin for 4.11p5 soon as well.

avatar image Steve Hardister ♦♦ STAFF Feb 11 '16 at 07:17 PM

After following the first 2 steps I cannot open the project to perform step 3. However, while researching I discovered a similar bug that started in Preview 4 and is fixed in Preview 5. Please download preview 5 and see if this issue persists.

avatar image Steve Hardister ♦♦ STAFF Feb 11 '16 at 08:51 PM

I missed your note before about opening on a Mac and was trying to open the Windows version. After following your steps on a Mac, the issue did not occur for 4.11Preview5, resulting in a successful package "SkookumDemo.ipa"

Your test file resides in: ...SkookemDemo 4.11 3>Saved>StageBuilds>IOS>SkookumDemo>Content>skookumscript>test.rtf

avatar image GreatGuru Feb 11 '16 at 09:04 PM

If the folder Saved/StagedBuilds/iOS contains a folder SkookumDemo that would collide with the executable also named SkookumDemo which would be packaged at the same folder level. Also the content folder being mounted by the runtime file system is cookeddata and not SkookumDemo so test.rtf would not be found. Two problems right there. The folder 'skookumscript` comes from the project's Content folder and has to end up in the package's content folder right beside the paks folder but obviously doesn't. Have you verified the ipa file that it contains in its Payload/SkookumDemo.app folder both your test.rtf in SkookumDemo/Content/skookumscript and the executable SkookumDemo? If so that is a conflict constituting essentially a corrupt archive. Try extracting the archive - do you get an error message? If not, does the extracted data contain both the excutable SkookumDemo and test.rtf?

avatar image GreatGuru Feb 16 '16 at 08:38 PM

Hi Steve - any update on this? Were you able to reproduce it?

avatar image Steve Hardister ♦♦ STAFF Feb 16 '16 at 09:37 PM

We are still looking at this and I should have more definitive information for you by noon tomorrow. In the meantime, have you tried updating to 4.11 preview 5?

avatar image Steve Hardister ♦♦ STAFF Feb 17 '16 at 10:11 PM

Had some technical issues on the Mac that set me back. But following your steps from scratch, I came up with the exact same results as before: No packaging errors, successfully creating an ipa file. Wasn't the initial issue that you were not able to create an ipa file successfully because you were getting the error: "Cannot create because a file with the same name already exists?"

Have you tried updating to preview 5 and setting your output to a different directory as troubleshooting steps? Are you able to create an ipa at all or does packaging fail when you get the error message? Please provide this information.

avatar image GreatGuru Feb 17 '16 at 10:17 PM

Hi Steve - Yes my original issue was that packaging failed but the underlying problem is that folders specified using +DirectoriesToAlwaysStageAsNonUFS= will get archived incorrectly. This may or may not result in an error during packaging apparently. The folder skookumscript has to end up in the same content folder as the Paks and it's not. Did you try unpacking the ipa as I suggested?

avatar image GreatGuru Feb 18 '16 at 01:52 AM

I have updated to 4.11p5 long ago. I tried both packaging with 4.11p5 and with latest 4.11 built from source. Both report an error that all my provisioning profiles are not valid (which they are, and they are not expired, and I have used them many times before). If I proceed anyway, 4.11p5 will fail with a code signing error, and 4.11 built from source will again fail with the error I started this thread on (Cannot create /Volumes/Dev/UnrealEngine/4.11/Projects/SkookumDemo/Binaries/IOS/Payload/SkookumDemo.app/SkookumDemo because a file with the same name already exists.). The Saved/StageBuilds folder - again - contains the wrong folder structure as described many times. Can you please try to unpack your ipa? You will see that it is no good because either the executable or the test text file will be missing.

avatar image GreatGuru Feb 11 '16 at 09:38 PM

Also please try packaging the same project for Win64 you'll see the folder structure is different = what it's supposed to be. The skookumscript folder ends up next to the Paks folder where it belongs. Also works fine on Android btw. Just on iOS and tVOS it doesn't. That is a bug.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I already see the issue. So that we don't collide with the executable name, all content is put in cookeddata/gamename. However, the code to copy the NonUFS data is not taking that into account for iOS, so it is putting in the root which collides with the executable. I'll look into a fix today.

-Pete

more ▼

answered Feb 18 '16 at 05:04 PM

avatar image

Ravlek STAFF
1.9k 4 6 34

avatar image Ravlek STAFF Feb 18 '16 at 04:57 PM

So, the provisioning profile issue is that the Apple World Wide Authority certificate expired. Go to https://www.apple.com/certificateauthority/ and download the WWDR certificate that expires in 2023. Double click it and import it to the System keychain, if you haven't already. The old one expired last Sunday, so that is relatively recent development. As for the StageAsNonUFS, I'll have a look today. It's possible something has changed in the last few months since 4.11 and 4.10 were similar which is causing this error.

-Pete

avatar image GreatGuru Feb 18 '16 at 05:59 PM

Thanks Pete - so I did this, generated new certificates and provisioning profiles but also had to delete the old WWDR certificate from both System and Login keychain for the Keychain to be happy. Unfortunately, now I am getting an error that the bundle identifier "com.YourCompany.[PROJECT_NAME]" does not match my provision profile. Makes sense, so I fixed that in the project settings and set it to "com.agoglabs.[PROJECT_NAME]" which matches the "com.agoglabs.*" of the profile, and confirmed that it is correctly set in DefaultEngine.ini. However I keep getting the error despite fixing this. It continues to claim that my bundle identifier is "com.YourCompany.[PROJECT_NAME]" when it's not. Tried deleting cooked and staged data but still getting this. Any insight into this would be helpful.

avatar image Ravlek STAFF Feb 18 '16 at 07:16 PM

Is your game content-only? If so, there is a bug in Preview 5 that will be fixed in the next preview which is not properly pulling the ini files from the content-only project.

avatar image GreatGuru Feb 18 '16 at 07:29 PM

Yes content-only. So the fix is checked into the 4.11 branch on GitHub?

avatar image Ravlek STAFF Feb 18 '16 at 07:58 PM

Ya, it will be two changes, look for something related to UE-24753. The actual bug was an iPhone 6s splash screen fix, but it also includes the fix for the content-only ini files. (change lists from P4 are 2863737 and 2863806).

avatar image Ravlek STAFF Feb 19 '16 at 03:13 PM

Ok, I've been looking into a fix for this, but I am not sure you really want to use the DirectoriesToAlwaysStageAsNonUFS for this. That particular ini is for files that will not be loaded by the Unreal File System and the intention there is they should be sitting at the root of the app. For instance, ue4commandline.txt is a NonUFS file and it sits in the payload root of the app next to the executable. There is a DirectoriesToAlwaysStageAsUFS which may be want you actually want here. However, the concern I have there is those directories will be placed in the pak file if you use pak for holding the content. How does the plugin attempt to access these scripts? Does it do an open directly or does it use the UE FileManager?

-Pete

avatar image GreatGuru Feb 19 '16 at 06:39 PM

Hmm this staging mechanism has been working just fine up until 4.10 and works fine on 4.11 for platforms other than iOS/tvOS, by placing the NonUFS folder inside the project content folder. There is nothing wrong with that IMO. NonUFS files like ue4commandline.txt that are handled internally by the build system can of course live anywhere they want as long as the path is known at runtime. Our plugin needs to store its data files separately from the pak file so we can update them. SkookumScript establishes a remote connection with the host system which allows downloading and installing of updated script data.

avatar image GreatGuru Feb 26 '16 at 08:11 AM

Hi so any update on this issue? I got latest 4.11 from GitHub and it is still not resolved. The DirectoriesToAlwaysStageAsNonUFS mechanism has been working great. Can we just make it work on iOS/tvOS like it did in 4.10 and like it does in 4.11 on Windows/Android and call it a day?

avatar image Steve Hardister ♦♦ STAFF Feb 29 '16 at 09:13 PM

For users who may be experiencing the same problem, this bug has been recorded as JIRA [UE-27608] and is scheduled to be fixed for the UE4.11 official release. Thank you for your patience, cooperation, and communication in helping us identify and resolve this issue.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question