stripping not working

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
laserpants
Posts: 7
Joined: Tue Mar 04, 2014 5:04 am

stripping not working

Post by laserpants »

Hi,

I'm attempting to use stripping with iOS by copying the link.xml file from the plugin folder to the Assets folder, but that's not preventing the build errors.

Unity v 4.3.4f1 with Easy Save v 2.33
User avatar
Joel
Moodkie Staff
Posts: 4871
Joined: Wed Nov 07, 2012 10:32 pm

Re: stripping not working

Post by Joel »

Hi there,

Please could you confirm:
  • What stripping level are you using?
  • What errors are you getting?
All the best,
Joel
laserpants
Posts: 7
Joined: Tue Mar 04, 2014 5:04 am

Re: stripping not working

Post by laserpants »

I'm attempting to use Strip Bytecode.

I get this error in the Unity editor log at build time:
Cross compilation job ES2.dll failed.
UnityEngine.UnityException: Failed AOT cross compiler: /Applications/Unity/Unity.app/Contents/BuildTargetTools/iPhonePlayer/mono-xcompiler --aot=full,asmonly,nodebug,ficall,static,outfile="ES2.dll.s" "ES2.dll" current dir : /Users/.../Temp/StagingArea/Data/Managed
result file exists: False
stdout:
stderr:

at UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultingFile) [0x00000] in <filename unknown>:0
at UnityEditor.MonoCrossCompile.CrossCompileAOT (BuildTarget target, System.String crossCompilerAbsolutePath, System.String assembliesAbsoluteDirectory, CrossCompileOptions crossCompileOptions, System.String input, System.String output, System.String additionalOptions) [0x00000] in <filename unknown>:0
at UnityEditor.MonoCrossCompile+JobCompileAOT.ThreadPoolCallback (System.Object threadContext) [0x00000] in <filename unknown>:0
UnityEditor.HostView:OnGUI()
User avatar
Joel
Moodkie Staff
Posts: 4871
Joined: Wed Nov 07, 2012 10:32 pm

Re: stripping not working

Post by Joel »

Hi there,

Usually if it's an error with the link.xml it would throw a different error. Could you confirm that this is only happening when Strip Bytecode is enabled?

Also sometimes the Asset Store importer leaves old files behind which may cause conflicts. Could you try deleting Easy Save completely from your project and reinstall from the Asset Store. To do this you will need to delete the following files/folders:
Assets/Plugins/Easy Save 2
Assets/Plugins/ES2.dll
Assets/Plugins/MoodkieSecurity.dll
Assets/Plugins/Metro/ES2.dll
Assets/Plugins/Metro/MoodkieSecurity.dll
Assets/Plugins/WP8/ES2.dll
Assets/Plugins/WP8/MoodkieSecurity.dll
All the best,
Joel
laserpants
Posts: 7
Joined: Tue Mar 04, 2014 5:04 am

Re: stripping not working

Post by laserpants »

Same result with either Strip Assemblies or Strip Bytecode. I deleted all ES2 folders and files and reimported from the Asset Store, but with the same result.
Cross compilation job ES2.dll failed.
UnityEngine.UnityException: Failed AOT cross compiler: /Applications/Unity/Unity.app/Contents/BuildTargetTools/iPhonePlayer/mono-xcompiler --aot=full,asmonly,nodebug,ficall,static,outfile="ES2.dll.s" "ES2.dll" current dir : /Users/.../Temp/StagingArea/Data/Managed
result file exists: False
stdout:
stderr:

at UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultingFile) [0x00000] in <filename unknown>:0
at UnityEditor.MonoCrossCompile.CrossCompileAOT (BuildTarget target, System.String crossCompilerAbsolutePath, System.String assembliesAbsoluteDirectory, CrossCompileOptions crossCompileOptions, System.String input, System.String output, System.String additionalOptions) [0x00000] in <filename unknown>:0
at UnityEditor.MonoCrossCompile+JobCompileAOT.ThreadPoolCallback (System.Object threadContext) [0x00000] in <filename unknown>:0
UnityEditor.HostView:OnGUI()
I don't know if this matters, but I am using other plugins as well: SpriteManager 2, EZ GUI, Prime 31 StoreKit, Prime 31 GameCenter, and Prime31 iOS Etc.

My iPad 1 keeps running out of memory and crashing the game, and I'm really hoping stripping will help.
User avatar
Joel
Moodkie Staff
Posts: 4871
Joined: Wed Nov 07, 2012 10:32 pm

Re: stripping not working

Post by Joel »

Hi there,

How about when you're using no stripping whatsoever? i.e. Stripping Level = Disabled.

All the best,
Joel
laserpants
Posts: 7
Joined: Tue Mar 04, 2014 5:04 am

Re: stripping not working

Post by laserpants »

Right, sorry :) When I use no stripping, it builds fine, no errors.
User avatar
Joel
Moodkie Staff
Posts: 4871
Joined: Wed Nov 07, 2012 10:32 pm

Re: stripping not working

Post by Joel »

I've just managed to get hold of a copy of Pro and I can confirm we're getting the same error. However, I've managed to track down the error to being a fault with Unity itself. For some reason it throws that error whenever it tries to cross-compile a DLL (which Unity never used to have a problem with). I'll get in touch with Unity and see if they can shed some light on the matter.

All the best,
Joel
User avatar
Joel
Moodkie Staff
Posts: 4871
Joined: Wed Nov 07, 2012 10:32 pm

Re: stripping not working

Post by Joel »

Hi again,

I've not managed to get through to Unity yet as they keep passing me off to different departments (sigh), but I ran a few more tests and managed to track down exactly what part of the cross-compilaion process is bugged.

Would I be right in saying that you're saving or loading a Dictionary? At my end, the error only seems to occur if I'm saving or loading a Dictionary.

If you are desperate for a work around, you should be able to achieve the same thing by saving and loading two Lists (one List containing the keys, and one List containing the values). Something like this:
// Saving
public void SaveDictionary<TKey,TValue>(Dictionary<TKey,TValue> dictionary, string path)
{
    List<TKey> keys = new List<TKey>();
    List<TValue> values = new List<TValue>();

    foreach (KeyValuePair<TKey, TValue> item in dictionary)
    {
        keys.Add(item.Key);
        values.Add(item.Value);
    }
    ES2.Save( keys, path+"keys" );
    ES2.Save( values, path+"values" );
}
// Loading
public Dictionary<TKey,TValue> LoadDictionary<TKey,TValue>(string path)
{
    List<TKey> keys = ES2.LoadList<TKey>( path+"keys" );
    List<TValue> values = ES2.LoadList<TValue>( path+"values" );
    Dictionary<TKey,TValue> dictionary = new Dictionary<TKey,TValue>();

    for(int i=0; i<keys.Count; i++)
    {
        dictionary.Add(keys, values;
    }

    return dictionary;
}


That was written straight into the forum, so there's bound to be a couple of small errors, but you should get the idea.

I'll let you know as soon as I hear anything useful from Unity.

All the best,
Joel
eggplant
Posts: 1
Joined: Fri Mar 14, 2014 11:27 pm

Re: stripping not working

Post by eggplant »

I'm also experiencing this issue with "Strip Byte Code" when saving a Dictionary. Looking forward to the fix! Thanks Joel.
Locked