Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Everyplay build error in Unity with Prime31 new build build system

Discussion in 'Unity Everyplay' started by andymads, Mar 23, 2015.

  1. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Support request #22517

    I have the latest SDK (1950-1300 March 11 2015) but this problem also happens with previous release.

    Basically the Everyplay build process in Unity fails when using Prime31's new build system (where the subfolder is placed under the Prime31 folder in Editor, rather that in Editor itself). See the Prime31 docs for details.

    The build process is ok when not using the new build system. I have tried with a few plugins, Etcetera 2.2, Vungle 2.3, and StoreKit 2.2.

    KeyNotFoundException: The given key was not present in the dictionary.
    System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (.TKey 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:108)
    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()

    The build process did complete but the Xcode project failed to build because the Everyplay files were missing.

    I have also notified Prime31 about this.
     
  2. surathunity3d

    surathunity3d

    Unity Technologies

    Joined:
    Sep 30, 2014
    Posts:
    128
    Hi,

    Is EVERYPLAY_IPHONE listed as a Scripting Define Symbol in Player Settings under iOS tab?
    If not, could you add that manually and try to build again.

    Cheers
    Surath
     
  3. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Yes, that is already listed.

    You should be quite easily be able to reproduce this issue yourself.
     
  4. surathunity3d

    surathunity3d

    Unity Technologies

    Joined:
    Sep 30, 2014
    Posts:
    128
    (This post is mostly for others who are facing the same issue)

    The temporary workaround in order to avoid conflict with Prime31 plugin is to change the build order for EP such that it happens before Prime31.

    I am not sure what Prime31's build order is but you can try for example -1 for Everyplay.
    The line you need to change is Line 15 in EveryplayPostprocessor.cs which is: [PostProcessBuild(1080)]
    Change that to [PostProcessBuild(-1)]

    @andymads asked the same question to Prime31. The thread can be found here:
    http://support.prime31.com/19671/new-build-system-causes-everyplay-build-issue

    We will investigate this further.

    Hope this helps!

    Cheers
    Surath
     
    drawcode likes this.
  5. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    I also found this morning that the Facebook Unity SDK has the same issue, and I suspect Unity Ads and Unity Analytics may also have it because I think they may use similar build systems.
     
  6. surathunity3d

    surathunity3d

    Unity Technologies

    Joined:
    Sep 30, 2014
    Posts:
    128
    Hi @andymads

    If the postprocess of P31 is breaking multiple plugins I reckon the best solution would be changing the build order of P31 instead of changing the same for the affected plugins one by one. Push it to the end of the order.

    Additionally, you should escalate this with their Dev Team / Support and ask them to fix this at their end.
    Unity Ads, Everyplay and FB SDK plugins have been building peacefully together in the same project for ages - I can assure you that.

    Cheers
    Surath
     
  7. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    It looks like the EveryPlay post processor is using the comments in the Xcode project file in addition to the actual GUIDs as lookup keys (I assume Unity Ads and any other affected plugins are doing the same). Because of that, any change to a comment will make a key lookup fail. Making a small change to the XCProject.cs file at line 93 will fix the issue. The change simply excludes the comment when looking up a GUID.


    Code (CSharp):
    1. if(!string.IsNullOrEmpty(_rootObjectKey)) {
    2.  
    3.     // ------ START MODIFICATION -------
    4.     // fuzzy search for the key. as long as the first 24 chars match all is well
    5.     var _actualRootObjectKey = _rootObjectKey.Substring( 0, 24 );
    6.     foreach( var k in _objects.Keys )
    7.         if( k.StartsWith( _actualRootObjectKey ) )
    8.             _rootObjectKey = k;
    9.     // ------ END MODIFICATION -------
     
    drawcode likes this.
  8. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    240
    We could add this workaround to EveryplayPostprocessor however that would not help much since many other plugins, like FaceBook use the same xCode editor. FaceBook plugin is usually used together with Everyplay so even we add the workaround the user would still get the error from the FaceBook plugin instead. In my opinion 3rd party plugins should not change the original keys or comments of the xCode projects, just add your own stuff without comments if you don't want them. Hopefully we can resolve these kind of plugin incompatibility issues in the future by all start using the Unity xCode API.
     
  9. CoalCzar

    CoalCzar

    Joined:
    Nov 25, 2012
    Posts:
    22
    Ran into the same problem with Unity 4.6.4p4, newest Everyplay, newest Prime31. Using either fix seems to solve the failed build, but gives me the error from this thread.
     
  10. CoalCzar

    CoalCzar

    Joined:
    Nov 25, 2012
    Posts:
    22
    So if anyone is updating Everyplay from an old version and can't get a build working, this is what happened to me:

    The old version of the plugin left behind two subfolders in the Editor folder:
    • XCodeEditor
    • XCodeBuildConfig
    these folders got moved & merged in the new version of the plugin under the Everyplay folder, but if you don't delete the old ones (under the root Editor folder), you will have build issues till the cows come home.