- Home /
Everyplay iOS integration issue
Hello,
I am trying to integrate Everyplay to my iOS game, and I am having some integration issue. I emailed Everyplay regarding the issue, but I have yet to receive a reply, so I decided to try the Unity Answers.
The main problem seems to be summarized by the following error:
ArgumentException: An element with the same key already exists in the dictionary. System.Collections.Generic.Dictionary`2[TKey,TValue].Add (.TKey key, .TValue value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404) Everyplay.XCodeEditor.PBXParser.ParseDictionary () (at Assets/Editor/Everyplay/XCodeEditor/PBXParser.cs:184) Everyplay.XCodeEditor.PBXParser.ParseValue () (at Assets/Editor/Everyplay/XCodeEditor/PBXParser.cs:144) Everyplay.XCodeEditor.PBXParser.ParseDictionary () (at Assets/Editor/Everyplay/XCodeEditor/PBXParser.cs:182) Everyplay.XCodeEditor.PBXParser.ParseValue () (at Assets/Editor/Everyplay/XCodeEditor/PBXParser.cs:144) Everyplay.XCodeEditor.PBXParser.Decode (System.String data) (at Assets/Editor/Everyplay/XCodeEditor/PBXParser.cs:49) Everyplay.XCodeEditor.XCProject..ctor (System.String filePath) (at Assets/Editor/Everyplay/XCodeEditor/XCProject.cs:81) EveryplayPostprocessor.ProcessXCodeProject (System.String path) (at Assets/Editor/Everyplay/Scripts/EveryplayPostprocessor.cs:123) EveryplayPostprocessor.PostProcessBuild_iOS (System.String path, System.String clientId) (at Assets/Editor/Everyplay/Scripts/EveryplayPostprocessor.cs:75) EveryplayPostprocessor.OnPostProcessBuild (BuildTarget target, System.String path) (at Assets/Editor/Everyplay/Scripts/EveryplayPostprocessor.cs:24) UnityEditor.HostView:OnGUI()
which results in the Everyplay folder to not appear on the XCode navigator, and, as a result, makes XCode throw the error "EveryplayGlesSupport.h file not found."
Now, the former error is thrown from the following lines of code in PBXParser class:
case DICTIONARY_ASSIGN_TOKEN:
valueObject = ParseValue();
dictionary.Add( keyString, valueObject );
break;
Now, I know nothing about iOS development, so I've done what little experimentations that I could, which were to change the code to several variations of the following:
case DICTIONARY_ASSIGN_TOKEN:
valueObject = ParseValue();
if (!dictionary.ContainsKey (keyString))
{
dictionary.Add( keyString, valueObject );
}
else
{
dictionary[keyString] = valueObject;
Debug.Log ("#### DUPLICATE ####");
Debug.Log (keyString);
}
break;
Unfortunately, this results in XCode not being about to open the build folder with the following pop-up error message:
[My Project] cannot be opened because the project file cannot be parsed.
I am currently using Google Play Game Services for Unity (https://github.com/playgameservices/play-games-plugin-for-unity), AdColony, and Everyplay - and am certain that this has something to do with the problem I am facing.
What are some things I can do to (a) zero-in on what the problem is, and/or (b) fix this issue?
Thanks!
EDIT:
So, on further investigation, I noticed that lines on porject.pbxproj seem... out of order(?) when I edit PBXParser class with the line above.

Does this cause XCode to not be able to open the project?
I have the same sort of issue, it's new, it worked .. yesterday! :(
$$anonymous$$y error message :
$$anonymous$$eyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary`2[T$$anonymous$$ey,TValue].get_Item (.T$$anonymous$$ey key) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150) Everyplay.XCodeEditor.XCProject..ctor (System.String filePath) (at Assets/Editor/Everyplay/XCodeEditor/XCProject.cs:93) EveryplayPostprocessor.ProcessXCodeProject (System.String path) (at Assets/Editor/Everyplay/Scripts/EveryplayPostprocessor.cs:124) EveryplayPostprocessor.PostProcessBuild_iOS (System.String path, System.String clientId) (at Assets/Editor/Everyplay/Scripts/EveryplayPostprocessor.cs:76) EveryplayPostprocessor.OnPostProcessBuild (BuildTarget target, System.String path) (at Assets/Editor/Everyplay/Scripts/EveryplayPostprocessor.cs:24) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
Answer by pmjo · Sep 08, 2014 at 05:55 AM
The problem seems to be the Adcolony plugin. It will do some changes to the xCode project which are not readable for the xCode editor.
I found a workaround for this issue:
Open the AdColonyPostProcess.cs file
Change the 200 on row 302 to 1081 like this: [PostProcessBuild(1081)] // <- this is where the magic happens, this attribute triggers unity to call this method when the build process has finished
This will make AdColony plugin to run post process stuff after Everyplay so the xCode project will be still readable for Everyplay.
I LOVE YOU!!!!!!!!!!
Just one question: How did you get the number 1081?
Hi,
I still have this issue :
$$anonymous$$eyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary`2[T$$anonymous$$ey,TValue].get_Item (.T$$anonymous$$ey key) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150) UnityEditor.XCodeEditor.XCProject..ctor (System.String filePath) (at Assets/Facebook/Editor/iOS/third_party/XCodeEditor-for-Unity/XCProject.cs:95) UnityEditor.FacebookEditor.XCodePostProcess.OnPostProcessBuild (BuildTarget target, System.String path) (at Assets/Facebook/Editor/FacebookPostprocess.cs:25) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
AND
$$anonymous$$eyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary`2[T$$anonymous$$ey,TValue].get_Item (.T$$anonymous$$ey key) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150) Everyplay.XCodeEditor.XCProject..ctor (System.String filePath) (at Assets/Editor/Everyplay/XCodeEditor/XCProject.cs:93) EveryplayPostprocessor.ProcessXCodeProject (System.String path) (at Assets/Editor/Everyplay/Scripts/EveryplayPostprocessor.cs:124) EveryplayPostprocessor.PostProcessBuild_iOS (System.String path, System.String clientId) (at Assets/Editor/Everyplay/Scripts/EveryplayPostprocessor.cs:76) EveryplayPostprocessor.OnPostProcessBuild (BuildTarget target, System.String path) (at Assets/Editor/Everyplay/Scripts/EveryplayPostprocessor.cs:24) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
I'm losing my $$anonymous$$d .... 1 week on it :'(
Thanks a lot for your help !!
(I'm using Chartboost 5.0, Facebook 6.0 and Everyplay)
Thanks !
pmjo, the problem has reoccured since the new update. Can you tell us how to find Everyplay's priority?
ababab5, I assume that Charboost or Facebook has a PostProcessing script just like AdColony and Everyplay has. I think it would be best for you to find those scripts, find the line similar to the one pmjo pointed out, and change the integer value. As stated above, it seems that Everyplay's priority has changed since the last update. I've emailed Everyplay asking how to find the priority on our own, so hopefully they will get back to me soon. I will keep you posted.
ababab5, the Everyplay's priority seems to still be 1080. So yeah, I would suggest trying to replicate the solution provided by pmjo - if it doesnt work out, I think it would be best for you to contact charboost and facebook.
Your answer