Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

FBX Exporter 4.0.1 does not work with Unity 2021.1.11 on Linux

Discussion in 'Asset Importing & Exporting' started by DevViktoria, Jun 25, 2021.

  1. DevViktoria

    DevViktoria

    Joined:
    Apr 6, 2021
    Posts:
    94
    I wanted to try the FBX Exporter and I am constantly getting the following error message:
    DllNotFoundException: UnityFbxSdkNative
    Autodesk.Fbx.NativeMethods+SWIGExceptionHelper..cctor () (at Library/PackageCache/com.autodesk.fbx@4.0.1/Runtime/Scripts/NativeMethods.cs:120)
    Rethrow as TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception.
    Autodesk.Fbx.NativeMethods..cctor () (at Library/PackageCache/com.autodesk.fbx@4.0.1/Runtime/Scripts/NativeMethods.cs:140)
    Rethrow as TypeInitializationException: The type initializer for 'Autodesk.Fbx.NativeMethods' threw an exception.
    Autodesk.Fbx.Globals..cctor () (at Library/PackageCache/com.autodesk.fbx@4.0.1/Runtime/Scripts/Globals.cs:814)
    Rethrow as TypeInitializationException: The type initializer for 'Autodesk.Fbx.Globals' threw an exception.
    UnityEditor.Formats.Fbx.Exporter.ModelExporter.ExportObjects (System.String filePath, UnityEngine.Object[] objects, UnityEditor.Formats.Fbx.Exporter.IExportOptions exportOptions, System.Collections.Generic.Dictionary`2[TKey,TValue] exportData) (at Library/PackageCache/com.unity.formats.fbx@4.0.1/Editor/FbxExporter.cs:4466)
    UnityEditor.Formats.Fbx.Exporter.ExportModelEditorWindow.Export () (at Library/PackageCache/com.unity.formats.fbx@4.0.1/Editor/ExportModelEditorWindow.cs:862)
    UnityEditor.Formats.Fbx.Exporter.ExportOptionsEditorWindow.OnGUI () (at Library/PackageCache/com.unity.formats.fbx@4.0.1/Editor/ExportModelEditorWindow.cs:602)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at /home/bokken/buildslave/unity/build/Editor/Mono/HostView.cs:418)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at /home/bokken/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:381)
    UnityEditor.DockArea.OldOnGUI () (at /home/bokken/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:371)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/IMGUIContainer.cs:366)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/IMGUIContainer.cs:676)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/IMGUIContainer.cs:648)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/IMGUIContainer.cs:641)
    UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/IMGUIContainer.cs:607)
    UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/IMGUIContainer.cs:596)
    UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/IMGUIContainer.cs:529)
    UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/Events/EventHandler.cs:125)
    UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/Events/MouseCaptureDispatchingStrategy.cs:83)
    UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/EventDispatcher.cs:377)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/EventDispatcher.cs:340)
    UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/EventDispatcher.cs:302)
    UnityEngine.UIElements.EventDispatcher.OpenGate () (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/EventDispatcher.cs:266)
    UnityEngine.UIElements.EventDispatcherGate.Dispose () (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/EventDispatcher.cs:75)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/EventDispatcher.cs:368)
    UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/EventDispatcher.cs:218)
    UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/Panel.cs:398)
    UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/UIElementsUtility.cs:466)
    UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/UIElementsUtility.cs:209)
    UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/UIElementsUtility.cs:74)
    UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at Library/PackageCache/com.unity.ui@1.0.0-preview.14/Core/UIElementsUtility.cs:28)
    UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at /home/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
    I tried to apply the workaround that was suggested in this thread:
    https://forum.unity.com/threads/uni...3-2f1-unityfbxsdknative-dll-not-found.838681/
    But without any luck.
     
  2. George-Ing

    George-Ing

    Unity Technologies

    Joined:
    Jan 14, 2020
    Posts:
    78
    Hey Viktoria,

    This sounds like a bug - Unity Linux is still very new so it wouldn't massively surprise me if this was something we've missed.

    Would you mind submitting a bug ticket with your project?
    https://unity3d.com/unity/qa/bug-reporting
     
  3. DevViktoria

    DevViktoria

    Joined:
    Apr 6, 2021
    Posts:
    94
    I did that :) Thank you for your advice.
     
  4. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
  5. DevViktoria

    DevViktoria

    Joined:
    Apr 6, 2021
    Posts:
    94
    Actually I have libstdc++-7 installed. So I guess that should not cause a DllNotFoundException. Or that can cause that exception?
     
  6. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi Viktoria, can you please try running this command and send me the result:

    /sbin/ldconfig -p | grep stdc++


    I think you may need to upgrade to libstdc++-9 package version or gcc 9.3 (if not already at that version).
     
  7. DevViktoria

    DevViktoria

    Joined:
    Apr 6, 2021
    Posts:
    94
    /sbin/ldconfig -p | grep stdc++


    The result is:
    Code (CSharp):
    1.     libstdc++.so.6 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    2.     libstdc++.so.6 (libc6) => /usr/lib/i386-linux-gnu/libstdc++.so.6
    3.     libstdc++.so.6 (libc6) => /usr/lib32/libstdc++.so.6
    4.  
    Which made me realize that I think I made a mistake I was posting the wrong package number. So on my machine the libstdc++-7-dev package is installed, but that is depending on the libstdc++6 in fact. So that is why the command lists the 6th version. And I am on Ubuntu 18.04 and in this is the highest version available in the repository. And the lib32stdc++-8-dev is the highest version of the dev package. So in this Ubuntu version the lib32stdc++-9-dev nor the gcc 9.3 is not available. (The highest version of gcc is gcc-8)
    The libstdc++-9-dev package is available in Ubuntu 20.04 but that is depending on libstdc++6 too. Similar the situation for the gcc-9 package. (Based upon some package search.) But I am not sure if I want to do a distro update just yet. :(.

    But does this means that the FBX Exporter now works only with Ubuntu 20.04 or higher?
     
  8. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    On Ubuntu 18.04, gcc-9 can be obtained from the ubuntu-toolchain-r PPA:
    https://askubuntu.com/questions/1140183/install-gcc-9-on-ubuntu-18-04

    Instead of test you should be able to use this PPA: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/ppa

    It is also possible to upgrade only libstdc++6:
    sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
    sudo apt-get update
    sudo apt-get install --only-upgrade libstdc++6


    Otherwise yes updating to Ubuntu 20.04 would be necessary.
     
  9. DevViktoria

    DevViktoria

    Joined:
    Apr 6, 2021
    Posts:
    94
    Thank you for the tip!
    The https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/ppa does not seem to have the gcc-9 for 18.04 if I observed correctly so I used the test repository.
    I installed the gcc-9 package and the g++-9 package, but I did not do the suggested update-alternatives step.
    I tried the FBX exporter and it worked :)
    The only warning message I got is:
    Code (CSharp):
    1. A meta data file (.meta) exists but its asset 'Assets/cwralrzp_Cube.fbx' can't be found. When moving or deleting files outside of Unity, please ensure that the corresponding .meta file is moved or deleted along with it.
    2. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    3.  
    I do not know if this is normal or not. I tested the export with a cube and I was able to import the fbx file with Blender :) .
     
  10. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Awesome glad it worked!

    Yes that message is a known bug, it should be fixed soon.