Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

IL2CPP error

Discussion in 'OSX' started by jkampitakis, Oct 19, 2018.

  1. jkampitakis

    jkampitakis

    Joined:
    Dec 27, 2015
    Posts:
    52
    We try to build for IL2CPP using 2018.2.13f1 but we get the following error:



    Failed running /Applications/Unity/Hub/Editor/2018.2.13f1/Unity.app/Contents/il2cpp/build/il2cppcore/il2cppcore.dll --convert-to-cpp --emit-null-checks --enable-array-bounds-check --compile-cpp --libil2cpp-static --platform="MacOSX" --architecture="x64" --configuration="Release" --outputpath="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Native/GameAssembly.dylib" --cachedirectory="/Users/john/Documents/llshooter/Assets/../Library/il2cpp_cache" --map-file-parser="/Applications/Unity/Hub/Editor/2018.2.13f1/Unity.app/Contents/Tools/MapFileParser/MapFileParser" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/Unity.TextMeshPro.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/CatlikeCoding.NumberFlow.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/AppStoreSettings.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/DOTweenPro.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/DOTween.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/Sirenix.Serialization.Config.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/Facebook.Unity.Settings.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/UnityEngine.Analytics.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/UnityEngine.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/Sirenix.OdinInspector.Attributes.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/Sirenix.Serialization.AOTGenerated.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/Sirenix.Serialization.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/Sirenix.Utilities.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/Stores.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/System.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/UnityEngine.Purchasing.dll" --assembly="/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/mscorlib.dll" --generatedcppdir="/Users/john/Documents/llshooter/Temp/StagingArea/Data/il2cppOutput"
    stdout:
    IL2CPP error for method 'System.String <>__AnonType0`2::ToString()' in assembly '/Users/john/Documents/llshooter/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll'
    Additional information: Build a development build for more information. Exception has been thrown by the target of an invocation.
    il2cpp.exe didn't catch exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Exception of type 'System.Exception' was thrown.
    at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, TypeReference typeReference)
    at Unity.IL2CPP.GenericsCollection.Inflater.ConstructGenericType(GenericContext context, TypeDefinition typeDefinition, IEnumerable`1 genericArguments)
    at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, GenericInstanceType genericInstanceType)
    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodReference methodReference, Context context)
    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(Instruction instruction, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(MethodBody methodBody, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(MethodDefinition methodDefinition, Context context)
    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodDefinition methodDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(TypeDefinition typeDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(ModuleDefinition moduleDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(AssemblyDefinition assemblyDefinition, Context context)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at Unity.Cecil.Visitor.Visitor.Visit[T](T node, Context context)
    at Unity.IL2CPP.GenericsCollection.GenericsCollector.CollectPerAssembly(IInteropDataCollector interopDataCollector, AssemblyDefinition assembly)
    at System.Linq.Enumerable.SelectIListIterator`2.MoveNext()
    at Unity.IL2CPP.GenericsCollection.GenericsCollector.MergeCollections(IEnumerable`1 collections)
    at Unity.IL2CPP.AssemblyConverter.Apply()
    at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder, NPath symbolsFolder, NPath executableAssembiesFolder, NPath monoLibFolder, NPath monoEtcFolder, NPath[] searchDirectories, String entryAssemblyName, NPath[] extraTypesFiles)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)
    stderr:
    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Exception of type 'System.Exception' was thrown.
    at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, TypeReference typeReference)
    at Unity.IL2CPP.GenericsCollection.Inflater.ConstructGenericType(GenericContext context, TypeDefinition typeDefinition, IEnumerable`1 genericArguments)
    at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, GenericInstanceType genericInstanceType)
    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodReference methodReference, Context context)
    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(Instruction instruction, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(MethodBody methodBody, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(MethodDefinition methodDefinition, Context context)
    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodDefinition methodDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(TypeDefinition typeDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(ModuleDefinition moduleDefinition, Context context)
    at Unity.Cecil.Visitor.Visitor.Visit(AssemblyDefinition assemblyDefinition, Context context)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at Unity.Cecil.Visitor.Visitor.Visit[T](T node, Context context)
    at Unity.IL2CPP.GenericsCollection.GenericsCollector.CollectPerAssembly(IInteropDataCollector interopDataCollector, AssemblyDefinition assembly)
    at System.Linq.Enumerable.SelectIListIterator`2.MoveNext()
    at Unity.IL2CPP.GenericsCollection.GenericsCollector.MergeCollections(IEnumerable`1 collections)
    at Unity.IL2CPP.AssemblyConverter.Apply()
    at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder, NPath symbolsFolder, NPath executableAssembiesFolder, NPath monoLibFolder, NPath monoEtcFolder, NPath[] searchDirectories, String entryAssemblyName, NPath[] extraTypesFiles)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)
    at Program.Main(String[] args)
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    3,622
    Can you provide a bug report with a project that causes this issue?
     
  3. Oscar-Tsang

    Oscar-Tsang

    Joined:
    Nov 7, 2012
    Posts:
    65
  4. jkampitakis

    jkampitakis

    Joined:
    Dec 27, 2015
    Posts:
    52
    sorry, this whole «build your game for macosx» is just a MESS....
     
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    3,622
    AMA_MR likes this.
  6. jkampitakis

    jkampitakis

    Joined:
    Dec 27, 2015
    Posts:
    52
    We get this when building for Macosx using unity 2018.2.13f1

    The Mono target is working the lL2CPP has problems..



    Undefined symbols for architecture x86_64:
    "_getUnityPurchasingAppReceipt", referenced from:
    _iOSStoreBindings_getUnityPurchasingAppReceipt_m4103466157 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    _iOSStoreBindings_get_appReceipt_m2498480463 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    (maybe you meant: _OSXStoreBindings_getUnityPurchasingAppReceipt_m643976844, _iOSStoreBindings_getUnityPurchasingAppReceipt_m4103466157 )
    "_unityPurchasingInterceptPromotionalPurchases", referenced from:
    _OSXStoreBindings_unityPurchasingInterceptPromotionalPurchases_m3411166610 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    _OSXStoreBindings_InterceptPromotionalPurchases_m769580797 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    _iOSStoreBindings_unityPurchasingInterceptPromotionalPurchases_m421098356 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    _iOSStoreBindings_InterceptPromotionalPurchases_m2936449487 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingInterceptPromotionalPurchases_m3411166610, _iOSStoreBindings_unityPurchasingInterceptPromotionalPurchases_m421098356 )
    "_unityPurchasingRetrieveProducts", referenced from:
    _iOSStoreBindings_unityPurchasingRetrieveProducts_m1942317051 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    _iOSStoreBindings_RetrieveProducts_m3230380609 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingRetrieveProducts_m689081799, _iOSStoreBindings_unityPurchasingRetrieveProducts_m1942317051 )
    "_unityPurchasingPurchase", referenced from:
    _iOSStoreBindings_unityPurchasingPurchase_m127163060 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    _iOSStoreBindings_Purchase_m925077806 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingPurchase_m1987719083, _iOSStoreBindings_unityPurchasingPurchase_m127163060 )
    "_unityPurchasingRestoreTransactions", referenced from:
    _iOSStoreBindings_unityPurchasingRestoreTransactions_m2532953743 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    _iOSStoreBindings_RestoreTransactions_m2847613056 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    (maybe you meant: _iOSStoreBindings_unityPurchasingRestoreTransactions_m2532953743, _OSXStoreBindings_unityPurchasingRestoreTransactions_m3672818507 )
    "_setUnityPurchasingCallback", referenced from:
    _iOSStoreBindings_setUnityPurchasingCallback_m1482920455 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    _iOSStoreBindings_SetUnityPurchasingCallback_m756868915 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    (maybe you meant: _OSXStoreBindings_setUnityPurchasingCallback_m3551531614, _iOSStoreBindings_setUnityPurchasingCallback_m1482920455 )
    "_unityPurchasingAddTransactionObserver", referenced from:
    _iOSStoreBindings_unityPurchasingAddTransactionObserver_m463851353 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    _iOSStoreBindings_AddTransactionObserver_m621098447 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    (maybe you meant: _iOSStoreBindings_unityPurchasingAddTransactionObserver_m463851353, _OSXStoreBindings_unityPurchasingAddTransactionObserver_m1174623098 )
    "_unityPurchasingFinishTransaction", referenced from:
    _iOSStoreBindings_unityPurchasingFinishTransaction_m1779103950 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    _iOSStoreBindings_FinishTransaction_m601113037 in 93A3A5F1CB413CC3390DFF1FEF258106.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingFinishTransaction_m3734261221, _iOSStoreBindings_unityPurchasingFinishTransaction_m1779103950 )
    ld: symbol(s) not found for architecture x86_64


    at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    3,622
    This error indicates that there is a native method named getUnityPurchasingAppReceipt which cannot be found. It sounds like the native library is not present. Is this library only makes sense for iOS, please make sure the C# code in iOSStoreBindings is not compiled for a macOS build.

    IL2CPP requires that all native libraries be present for the proper platform at build time, where Mono does not require this until run time.
     
  8. jkampitakis

    jkampitakis

    Joined:
    Dec 27, 2015
    Posts:
    52
    Unity IAP is causing this error.
    I am attaching you an empty project with ONLY the Unity IAP plugin inside.

    Try to build for MACOSX / IL2CPP and you will see this error
     

    Attached Files:

  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    3,622
    I'd recommend submitting this project with a bug report via the Unity editor. Then the IAP team at Unity can let you know when it is corrected.
     
  10. jkampitakis

    jkampitakis

    Joined:
    Dec 27, 2015
    Posts:
    52
    Ok thank you.
     
  11. Oscar-Tsang

    Oscar-Tsang

    Joined:
    Nov 7, 2012
    Posts:
    65
    Still no one look at it..... Fail to submit to appstore. osx build is meaningless..
     
  12. AMA_MR

    AMA_MR

    Joined:
    Mar 23, 2018
    Posts:
    17
    Thanks Josh. Much obliged.