Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
405 views
in Technique[技术] by (71.8m points)

augmented reality - Sceneform Dependencies for 1.16.0 (Not AndroidX Compatible)

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.

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. 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. 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.

  2. 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. Migrate the project to Filament/Unity
  2. Downgrade my codes back to 1.15.0 and redo my project
  3. Wait for somebody to fix the bug or I go fix the bug (which I don't know how to)

Btw, I also have a question on 1.17.1 and how different it is from 1.16.0, and why it is similar to 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)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...