【问题标题】:QR Scanning in HoloLens - DLL errorsHoloLens 中的 QR 扫描 - DLL 错误
【发布时间】:2019-08-21 15:50:14
【问题描述】:

我正在尝试从 HoloLens 中实现 QR 码阅读器,使用 Mike Taulty 的解决方案 (https://mtaulty.com/2016/12/28/windows-10-uwp-qr-code-scanning-with-zxing-and-hololens/)。但是,我在 Unity 中构建项目时遇到问题,因为我收到构建错误:"Assets\Placeholder.cs(20,9): error CS0103: The name 'MediaFrameQrProcessing' does not exist in the current context",这似乎暗示 DLL 无法正常工作?我的项目中已经有一个同名的 DLL,我认为这个 DLL 可以解决这个问题,但似乎没有。

我正在运行 Unity 2018.4.1 和 Visual Studio 2019。我在他的 GitHub 存储库 (https://github.com/mtaulty/QrCodes) 之上构建。

这是引发构建错误的块。找不到MediaFrameQrProcessing

public void OnScan()
    {
        this.textMesh.text = "scanning for 30s";
        #if !UNITY_EDITOR
        MediaFrameQrProcessing.Wrappers.ZXingQrCodeScanner.ScanFirstCameraForQrCode(
            result =>
            {
                UnityEngine.WSA.Application.InvokeOnAppThread(() =>
            {
                  this.textMesh.text = result ?? "not found";
              },
            false);
            },
            TimeSpan.FromSeconds(30));
        #endif
    }

预期:没有事件的项目构建

实际结果:Assets\Placeholder.cs(20,9): error CS0103: The name 'MediaFrameQrProcessing' does not exist in the current context 构建错误。这应该被 DLL 覆盖

导入设置截图:

【问题讨论】:

  • 您是否将您的 dll 放在 Plugins 文件夹中?您是否已将 DLL 配置为针对此环境进行编译?你能贴一张DLL及其配置的图片吗
  • @LudovicFeltz 我添加了导入设置的图片
  • 一切似乎都很好,但我不知道复选标记“不处理”是什么意思,而且我在文档中没有找到它...尝试取消选中它。我很确定问题出在这个配置的某个地方。也许看看documentation
  • 在 Unity 2018.4 中,脚本后端默认设置为 IL2CPP。如果您没有将其更改为标记为过时并在 2019 年删除的 .NET,则构建不会考虑您的 DLL

标签: c# unity3d qr-code hololens


【解决方案1】:

建议尝试用unity2017构建。我使用 unity2017.4.31f1 在存储库中构建了统一项目,它似乎工作正常。

更新:

我用2018.4.3新建了一个项目,做了一些简单的测试,使用了这样的Import Setting后没有抛出这个错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-02
    • 1970-01-01
    • 2016-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多