1.16.0 的 Sceneform 依赖项(不兼容 AndroidX) [英] Sceneform Dependencies for 1.16.0 (Not AndroidX Compatible)

查看:29
本文介绍了1.16.0 的 Sceneform 依赖项(不兼容 AndroidX)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位使用 Sceneform 1.16.0 的人,大家好,有几个问题让我感到不安.如果您知道如何解决这些问题,请给我一些建议.

Hi all to those who are using Sceneform 1.16.0, there were several issues that I found disturbing. Do give me some advice if you know how to fix these issues.

Sceneform 1.15.0 插件在较新的 Android Studio 平台 >3.6+ 上崩溃后,我根据 github sceneform-sdk 页面的建议转移到 1.16.0.安装 Sceneform sdk 1.16.0 后,我遇到了几个主要问题.

After the Sceneform 1.15.0 plugin broke on newer Android Studio platform >3.6+, I made the shift to 1.16.0 on the advice of the github sceneform-sdk page. After installing the Sceneform sdk 1.16.0, I faced several major issues.

  1. SDK 与 androidx 不兼容.即使我手动将注释更改为 androidx: import androidx.annotation.Nullable;import androidx.annotation.RequiresApi;,有些东西刚刚坏了 -->尽管我的 ViewRenderables 代码是从 github 页面中提取的典型示例代码,但它仍然存在漏洞.这是与我当前的代码有些相似的代码示例.
  1. The sdk is not androidx compatible. Even though I changed the annotations to androidx manually: import androidx.annotation.Nullable; import androidx.annotation.RequiresApi;, some things just broke --> My ViewRenderables code cracks even though it is the typical sample codes taken from the github page. This is the code sample that is vaguely similar to my current code.

          Node tigerTitleNode = new Node();
          tigerTitleNode.setParent(model);
          tigerTitleNode.setEnabled(false);
          tigerTitleNode.setLocalPosition(new Vector3(0.0f, 1.0f, 0.0f));
          ViewRenderable.builder()
                  .setView(this, R.layout.fragment_stage_data)
                  .build()
                  .thenAccept(
                          (renderable) -> {
                              tigerTitleNode.setRenderable(renderable);
                              tigerTitleNode.setEnabled(true);
                          })
                  .exceptionally(
                          (throwable) -> {
                              throw new AssertionError("Could not load card view.", throwable);
                          }
                  );
        });

  1. 如果我选择使用旧的支持包 implementation "com.android.support:appcompat-v7:28.0.0" 如 github 示例页面上的建议,它也是一个问题,例如,如果我打算在 androidx 中使用较新的支持库包,我将难以管理代码冲突或错误.

  1. If I choose to use the old support packages implementation "com.android.support:appcompat-v7:28.0.0" as suggested on the github sample page, it is also a problem, for example, if I intend to use the newer support library packages in androidx, I would have difficulties managing code conflicts or bugs.

Sceneform SDK 库的状态.从 reddit 聊天中,有些人建议转向其他渲染引擎,如 Filament 或其他 3rd 方游戏引擎,如 Unity.我理解构建 Sceneform 库和管理它们的困难,但突然弃用"了对于希望为 AR 进行本机编程的人来说,这个项目是一个问题.

我发现同样令人失望的是,3 个月前(预计 2020 年 6 月)的最新"示例代码仍在使用旧的支持库,而一些节奏更快的 Google 团队已经在构建顶级 androidx 功能.(向 fredsa 和 tpsiaki 表示抱歉,他一直在努力帮助从 Filament 引擎 1.7.0 更新库,但我希望看到一些用 androidx 编写的代码以供参考).

The state of Sceneform SDK libraries. From reddit chats, some people have suggested the shift to other rendering engines like Filament or other 3rd party game engines like Unity. I understand the difficulties of building the Sceneform libraries and managing them, but the sudden "deprecation" of this project is a problem to people who wish to do native programming for AR.

I find that it was also a disappointment that the 'newest' sample codes from 3 months ago (est. June 2020) were still using the old support libs when the some of the more fast-paced Google teams are already building on top androidx capabilities. (Sorry to fredsa, tpsiaki who has been so hard at work trying to help update the library from Filament engine 1.7.0, but I would like to see some codes written in androidx for reference).

现在我希望能找到人对我目前的项目提出一些建议:

Right now I hope to find somebody to actually give some suggestions to my current project:

  1. 将项目迁移到 Filament/Unity
  2. 将我的代码降级回 1.15.0 并重做我的项目
  3. 等待有人修复错误,否则我会去修复错误(我不知道该怎么做)

顺便说一句,我也有一个关于1.17.1的问题,它与1.16.0有什么不同,以及为什么它与1.15.0相似

这是我的代码错误,如果可以保存我的项目,请提供帮助.

This is my code error and do assist if my project can be saved.

2020-09-01 11:46:43.335 3542-3571/? E/WindowManager: RemoteException occurs on reporting focusChanged, w=Window{41c8196 u0 com.sutd.swatapp/com.sutd.swatapp.mainactivity.MainActivity EXITING}
    android.os.DeadObjectException
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(Binder.java:1145)
        at android.view.IWindow$Stub$Proxy.windowFocusChanged(IWindow.java:500)
        at com.android.server.wm.WindowState.reportFocusChangedSerialized(WindowState.java:3981)
        at com.android.server.wm.WindowManagerService$H.handleMessage(WindowManagerService.java:5539)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:65)
        at com.android.server.ServiceThread.run(ServiceThread.java:44)

推荐答案

让我来回答你的问题,即使它已经一年了.确实,原始 Sceneform SDK 的最新发布版本与 AndroidX 不兼容.您可以自己轻松更改此设置,但还有更好的选择.

let me answer your question even if it is already a year old. It is true that the last released version of the original Sceneform SDK is not compatible with AndroidX. You can change this quite easily by yourself, but there are better options out there.

  • ARCore SDK for Android: Scratch Sceneform and work directly with ARCore, but that would require you to work with OpenGL.
  • Google ARCore SDK for Unity: If you know about Unity
  • Sceneform Maintained Android SDK: Based on Sceneform with latest compatibly and functionalities from Android (including androidx**), ARCore and Filament. Currently a small community is working on it to keep it up to date and to develop new features.

如果您想了解有关 Sceneform 社区维护版本的更多信息,请查看此 中篇文章

If you want to know more about the community maintained version of Sceneform check out this Medium Article

这篇关于1.16.0 的 Sceneform 依赖项(不兼容 AndroidX)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆