Search Unity

[Android] BuildMethodException (2017.3.1, IL2CPP)

Discussion in 'Scripting' started by Qbit86, Feb 14, 2018.

  1. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    After adding `<assembly fullname="Nethereum.Unity" preserve="all"/>` node to `link.xml` I've got this build error. No human-readable message. What does it mean, how to solve?
    Code (csharp):
    1. UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
    2. at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x0020e] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:181
    3. at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:88
    4. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    5. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    6. UnityEngine.Logger:Log(LogType, Object)
    7. UnityEngine.Debug:LogError(Object)
    8. UnityEditor.BuildPlayerWindow:CallBuildMethods(Boolean, BuildOptions) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:93)
    9. UnityEditor.BuildPlayerWindow:GUIBuildButtons(IBuildWindowExtension, Boolean, Boolean, Boolean, BuildPlatform) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:881)
    10. UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings() (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:812)
    11. UnityEditor.BuildPlayerWindow:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:426)
    12. System.Reflection.MonoMethod:InternalInvoke(MonoMethod, Object, Object[], Exception&)
    13. System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
    14. System.Reflection.MethodBase:Invoke(Object, Object[])
    15. UnityEditor.HostView:Invoke(String, Object) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:295)
    16. UnityEditor.HostView:Invoke(String) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:288)
    17. UnityEditor.HostView:OldOnGUI() (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:107)
    18. UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI(Event) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:182)
    19. UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent(Event) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:338)
    20. UnityEngine.Experimental.UIElements.IMGUIContainer:HandleEvent(EventBase) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:322)
    21. UnityEngine.Experimental.UIElements.EventDispatcher:DispatchEvent(EventBase, IPanel) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\EventDispatcher.cs:250)
    22. UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\UIElementsUtility.cs:251)
    23. UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\UIElementsUtility.cs:78)
    24. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Runtime\IMGUI\Managed\GUIUtility.cs:175)
     
  2. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    @Yury-Habets Are there any estimates when Unity is stable and usable? Should I try 2018.1 beta, or there are no chances build process is fixed there?
     
  3. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Is there anything else in the Editor.log which looks like it is related? I would hope Unity provides some additional information, as this error message is not actionable.
     
  4. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    I see nothing like that.

    That's the issue.

    I cannot upload log file via “Upload a File” button: “The uploaded file does not have an allowed extension. Editor-1.log”. Let me try Pastebin... https://pastebin.com/raw/E0Kb5ktL
     
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Yeah, wow, that is not good. I have no idea what the problem is. Can you submit a bug report? We should at least determine why there is no actionable error reported.
     
    Qbit86 likes this.
  6. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    After some manipulations (like reimporting, removing `Library/`, restarting, etc.) I've got another log-file. The error is the same, no human-friendly message again, but contains more details somewhat related to IL2CPP. (Again: everything works fine in case of Mono+Android or IL2CPP+Editor; the problem reveals in case of IL2CPP+Android. If entry in `link.xml` is not added, then build is fine, but runtime error related to stripping arises.)

    https://pastebin.com/raw/R5PiE6gt

    For example:
    Code (csharp):
    1.  
    2. il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:26085:27: error: no viable conversion from 'BigInteger_t1403543702' to 'BigInteger_t1403543703'
    3.                BigInteger_t1403543703  L_30 = ((Transaction_t125474940_StaticFields*)il2cpp_codegen_static_fields_for(Transaction_t125474940_il2cpp_TypeInfo_var))->get_DEFAULT_GAS_PRICE_0();
    4.                                        ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    5. D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:8869:9: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'BigInteger_t1403543702' to 'const BigInteger_t1403543703 &' for 1st argument
    6. struct  BigInteger_t1403543703
    7.        ^
    8. D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:26107:27: error: no viable conversion from 'BigInteger_t1403543702' to 'BigInteger_t1403543703'
    9.                BigInteger_t1403543703  L_36 = ((Transaction_t125474940_StaticFields*)il2cpp_codegen_static_fields_for(Transaction_t125474940_il2cpp_TypeInfo_var))->get_DEFAULT_GAS_LIMIT_1();
    10.                                        ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    11. D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:8869:9: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'BigInteger_t1403543702' to 'const BigInteger_t1403543703 &' for 1st argument
    12. struct  BigInteger_t1403543703
    13.        ^
    14. D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:26147:67: error: cannot initialize a parameter of type 'HexRPCType_1_t3727270449 *' with an lvalue of type 'HexBigInteger_t3583925460 *'
    15.                BigInteger_t1403543703  L_51 = HexRPCType_1_get_Value_m78796562(L_50, /*hidden argument*/HexRPCType_1_get_Value_m78796562_RuntimeMethod_var);
    16.                                                                                ^~~~
    17. D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:15512:183: note: expanded from macro 'HexRPCType_1_get_Value_m78796562'
    18. #define HexRPCType_1_get_Value_m78796562(__this, method) ((  BigInteger_t1403543703  (*) (HexRPCType_1_t3727270449 *, const RuntimeMethod*))HexRPCType_1_get_Value_m78796562_gshared)(__this, method)
    19.                                                                                                                                                                                      ^~~~~~
    20. D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:26149:95: error: cannot initialize a parameter of type 'HexRPCType_1_t3727270449 *' with an lvalue of type 'HexBigInteger_t3583925460 *'
    21.                BigInteger_t1403543703  L_53 = HexRPCType_1_op_Implicit_m405091519(NULL /*static, unused*/, L_52, /*hidden argument*/HexRPCType_1_op_Implicit_m405091519_RuntimeMethod_var);
    22.                                                                                                            ^~~~
    23. D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:15514:281: note: expanded from macro 'HexRPCType_1_op_Implicit_m405091519'
    24. #define HexRPCType_1_op_Implicit_m405091519(__this /* static, unused */, p0, method) ((  BigInteger_t1403543703  (*) (RuntimeObject * /* static, unused */, HexRPCType_1_t3727270449 *, const RuntimeMethod*))HexRPCType_1_op_Implicit_m405091519_gshared)(__this /* static, unused */, p0, method)
    25.                                                                                                                                                                                                                                                                                        ^~
    26. D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:26152:67: error: cannot initialize a parameter of type 'HexRPCType_1_t3727270449 *' with an lvalue of type 'HexBigInteger_t3583925460 *'
    27.                BigInteger_t1403543703  L_55 = HexRPCType_1_get_Value_m78796562(L_54, /*hidden argument*/HexRPCType_1_get_Value_m78796562_RuntimeMethod_var);
    28.                                                                                ^~~~
    29. D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:15512:183: note: expanded from macro 'HexRPCType_1_get_Value_m78796562'
    30. #define HexRPCType_1_get_Value_m78796562(__this, method) ((  BigInteger_t1403543703  (*) (HexRPCType_1_t3727270449 *, const RuntimeMethod*))HexRPCType_1_get_Value_m78796562_gshared)(__this, method)
    31.                                                                                                                                                                                      ^~~~~~
    32. D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:26155:67: error: cannot initialize a parameter of type 'HexRPCType_1_t3727270449 *' with an lvalue of type 'HexBigInteger_t3583925460 *'
    33.                BigInteger_t1403543703  L_57 = HexRPCType_1_get_Value_m78796562(L_56, /*hidden argument*/HexRPCType_1_get_Value_m78796562_RuntimeMethod_var);
    34.                                                                                ^~~~
    35. D:\Viktor\Projects\block-paper-scissors\bps-unity-client\Temp\StagingArea\Il2Cpp\il2cppOutput\Bulk_Nethereum.Unity_0.cpp:15512:183: note: expanded from macro 'HexRPCType_1_get_Value_m78796562'
    36. #define HexRPCType_1_get_Value_m78796562(__this, method) ((  BigInteger_t1403543703  (*) (HexRPCType_1_t3727270449 *, const RuntimeMethod*))HexRPCType_1_get_Value_m78796562_gshared)(__this, method)
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Ok, this makes some sense now. It looks like that assembly is causing some problem with IL2CPP. I think that this is a bug in IL2CPP, as it should never generate C++ code that fails to compile. Can you submit a bug report with this project?
     
    Qbit86 likes this.
  8. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    https://fogbugz.unity3d.com/default.asp?1002169_dgfv0vagd5osjk09

    Looks like same types like `BigInteger` are compiled to different (hence incompatible) C++ types, depending on which assembly they are referenced from.

    Please let me know if something becomes clear or workaround is found. Maybe the issue is fixed in newer versions; any ETA for Unity 2018 non-beta?
     
  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Thanks! We will let you know via the bug report about the status of this issue. I'm not sure when 2018.1 will be out of beta, sorry. I expect that we will back port a fix for this to at least 2017.3 as well though.
     
    Yury-Habets and Qbit86 like this.