Skip to content

DllNotFoundException on .riv import under Linux #104

@Faulo

Description

@Faulo

Using Unity 6000.0,47f1 in a headless Linux environment, rive version 0.3.6.

Opening this Unity project (containing an empty .riv asset):
Rive Test Project.zip

During asset import, Unity logs:

Start importing Assets/empty.riv using Guid(b7e55e8308b1b8a4ba6ced37f57e1356) (ScriptedImporter)DllNotFoundException: rive assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Rive.EmbeddedAssetDataLoader.loadEmbeddedAssetList(byte[],uintptr)
  at Rive.EmbeddedAssetDataLoader+<LoadEmbeddedAssetDataFromRiveFileBytes>d__2.MoveNext () [0x00059] in ./Library/PackageCache/app.rive.rive-unity@e17cb4de3253/Runtime/EmbeddedAssetDataLoader.cs:40 
  at Rive.AssetImporter.OnImportAsset (UnityEditor.AssetImporters.AssetImportContext ctx) [0x001be] in ./Library/PackageCache/app.rive.rive-unity@e17cb4de3253/Editor/AssetImporter.cs:107 
  at UnityEditor.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.AssetImporters.AssetImportContext ctx) [0x00001] in /home/bokken/build/output/unity/unity/Modules/AssetPipelineEditor/Public/ScriptedImporter.cs:25 

(Filename: ./Library/PackageCache/app.rive.rive-unity@e17cb4de3253/Runtime/EmbeddedAssetDataLoader.cs Line: 40)

The project also contains these tests to reproduce:

using NUnit.Framework;
using UnityEditor;
using UnityEngine;
using UnityEngine.TestTools;

[TestFixture("Assets/empty.riv")]
public class RiveTests {
    private readonly string path;

    public RiveTests(string path) {
        this.path = path;
    }

    [Test]
    public void TestImporterExists() {
        AssetImporter importer = AssetImporter.GetAtPath(path);

        Assert.That(importer, Is.InstanceOf<Rive.AssetImporter>(), $"Failed to load rive importer at '{path}'.");
    }

    [Test]
    public void TestImportDoesNotThrow() {
        AssetImporter.GetAtPath(path).SaveAndReimport();

        LogAssert.NoUnexpectedReceived();
    }

    [Test]
    public void TestAssetExists() {
        Object asset = AssetDatabase.LoadMainAssetAtPath(path);

        Assert.That(asset, Is.InstanceOf<Rive.Asset>(), $"Failed to load rive asset at '{path}'.");
    }
}

On Windows, all 3 tests pass, while on Linux, the first test passes, while the latter two fail with:

Unhandled log message: '[Exception] DllNotFoundException: rive assembly:<unknown assembly> type:<unknown type> member:(null)'. Use UnityEngine.TestTools.LogAssert.Expect

and

  Failed to load rive asset at 'Assets/empty.riv'.
  Expected: instance of <Rive.Asset>
  But was:  <UnityEditor.DefaultAsset>

The tests are executed with something like:

./Unity -batchmode -projectPath "Rive Test Project" -runTests -testPlatform EditMode

Stuff I tried:

  • Using Rive v0.3.7-canary.17.
  • Forcing librive.so to load via the "Load on startup" inspector flag.
  • Running Unity with the -nographics flag.
  • Other .riv assets, with more content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions