- Home /
Cross platform dlls (ios,android,pc)
I would like to build some library code into cross platform (pc,android,ios) dlls. On android and pc it works, on iOS it fails to build:
Cross compilation job myDll.dll failed.
UnityEngine.UnityException: Failed AOT cross compiler: /Applications/Unity/Unity.app/Contents/BuildTargetTools/iPhonePlayer/mono-xcompiler --aot=full,asmonly,nodebug,nimt-trampolines=512,static,outfile="myDll.dll.s" "myDll.dll" current dir : /Developer-old/Test/Repositories/Project/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.MonoCrossCompile:CrossCompileAOTDirectoryParallel(BuildTarget, CrossCompileOptions, String, String, String)
PostProcessiPhonePlayer:PostProcess(BuildTarget, String, String, String, String, String, String, String, BuildOptions, RuntimeClassRegistry)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
I have some code like this in the dll:
#if UNITY_ANDROID && !UNITY_EDITOR
DoStuff();
#endif
Could it be that the iOS build fails because of these platform specific parts? The dll would contain only android specific code, but it would be annoying if we had to delete it every time we wanted to build the project for ios. Any ideas how to fix this?
Answer by Graham-Dunnett · Dec 06, 2012 at 03:45 PM
No, it's not a Unity bug. For iOS all game script code has to be converted into Arm assembler. We do this by compiling the script code. My guess is that your DLL only contains byte code.
"$$anonymous$$y guess is that your DLL only contains byte code."
What does that even mean?
Here is a library that causes us trouble: https://launchpad.net/nunitlite
finding a dll that causes this error can be trouble, is there a way to analyse this somehow ?
how can I fix this issue, I want to call IOS native functions and Android native functions from a DLL, how can I achieve this?
Your answer
Follow this Question
Related Questions
Local Account System On Mobile Devices 0 Answers
Targeting multiple OS 1 Answer
Cross platform multiplayer 3 Answers
Database integration for iOS and Android in Unity3d 1 Answer