Search Issue Tracker

Fixed

Votes

2

Found in

4.6.2f1

Issue ID

669467

Regression

No

Error when trying to append a project after removing 'Unity-iPhone Tests' target in xcode

iOS

-

To Reproduce:

1. Open the attached project.
2. Build to iOS, make sure to Append to the existing project in the "XCode-iOS" folder.
3. "Error building Player: ArgumentException: An element with the same key already exists in the dictionary." is thrown in console.

Or simply create a new project, build , remove 'Unity-iPhone Tests' in xcode, build with append
Error building Player: NullReferenceException: Object reference not set to an instance of an object" is thrown.

Comments (27)

  1. aroha

    May 26, 2015 06:40

    Still happening in 4.6.5p3.

  2. supernat

    Apr 23, 2015 20:57

    For me, this problem was caused by adding files to my XCode project after it was created in Unity, but specifically after adding files that were already added in an older project file that maybe existed in a different location. I'm not sure, but I found duplicate entries in the project XML file, removed them, and it fixed the problem. Look in your XCode project file (located at your_export_dir/Unity-iPhone.xcodeproj/project.pbxproj.) I went to the CustomTemplate section and checked each entry starting at the top that I knew I had added folders for manually, then found them duplicated below by searching for "name = whatever" where whatever is the value that is between /* and */ in the CustomTemplate section. There were two sections in the XML below that that said "name = whatever", so that's where Unity was failing to build for me. After removing the offending files/folders, you may have to add them back. In my case, the same files were listed twice for some reason.

  3. perplex_bcn

    Mar 12, 2015 06:31

    Please, ignore my previous post. I was replacing and appending over an already existing Xcode folder. Starting the process on a new folder did the trick.

  4. perplex_bcn

    Mar 11, 2015 18:09

    It's also happening on 4.6.3p2.

  5. PCBL

    Mar 11, 2015 01:14

    Having same issue here. Any reasonable work around?

  6. dookeybre

    Mar 04, 2015 08:59

    I am using 4.6.2f1 and I found a workaround. I implement ads and other plugins from xCode. Only Kamcord(used for capturing video) is implemented in unity.
    I dont know if this can help, but you could try.

    So this is my solution for this problem:
    1. Copy xCode and Unity projects just in case :)
    2. Delete references from xCode project to all plugins that you build from unity (I am only using Kamcord from Unity)
    3. Delete all files in data folder
    4. Delete all files in Library folder and remove references in xCode project to those files
    5. Append from unity
    6. Add references for missing files in library folder(libiPhone-lib.a, RegisterFeatures.cpp, RegisterFeatures.h, RegisterMonoModules.cpp, RegisterMonoModules.h)
    7. Overwrite Info.plist from copy you made in first step
    8.Build and run from xCode

  7. zalogic

    Mar 03, 2015 08:54

    Did anybody found any workaround for this issue? It's very annoying.

  8. zalogic

    Mar 03, 2015 08:36

    Can confirm it's still happening on Unity 4.6.3p1!

  9. funx

    Mar 01, 2015 20:04

    Still happening in 4.6.3 p1 . Everytime I do an iOS rebuild I have to re-do a dozen customizations I've done to the Xcode project and it's slowing down my team's whole output unbelievably.

  10. afrokick

    Feb 26, 2015 08:21

    Reproduced on 4.6.3f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.