1

As many of you already know, AR libraries are currently at version 1.17.1. Since Android studio import plugin is deprecated, I have a hard time importing and using models in my AR scene.

Currently I have 2 .gltf models in my raw folder and I have the following code trying to show a model in the screen :

ModelRenderable.builder()
    .setSource(context.applicationContext, context.resources.getIdentifier(name, "raw", context.packageName))
    .build()
    .thenAccept {
        renderable = it
     }
     .exceptionally {
        print("Error : $it")
        null
     }

When I try to add the model, I am getting the following exception :

2020-12-01 17:34:27.012 24894-26864/com.inform.ar E/ModelRenderable: Unable to load Renderable registryId='android.resource://com.inform.ar/raw/armchair'
java.util.concurrent.CompletionException: java.lang.AssertionError: No RCB file at uri: android.resource://com.inform.ar/raw/armchair
    at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:278)
    at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:284)
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1629)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:919)
 Caused by: java.lang.AssertionError: No RCB file at uri: android.resource://com.inform.ar/raw/armchair
    at com.google.ar.sceneform.rendering.LoadRenderableFromSfbTask.byteBufferToSfb(LoadRenderableFromSfbTask.java:191)
    at com.google.ar.sceneform.rendering.LoadRenderableFromSfbTask.lambda$downloadAndProcessRenderable$0$LoadRenderableFromSfbTask(LoadRenderableFromSfbTask.java:121)
    at com.google.ar.sceneform.rendering.-$$Lambda$LoadRenderableFromSfbTask$A8YYsoT3V_A--F80fBJ_ZLNSnhc.get(Unknown Source:4)
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1627)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
    at java.lang.Thread.run(Thread.java:919) 

What is wrong with this code? There are no official tutorials that are updated. All demos are not working properly and most of the tutorials are using the plugin to import models. Do any of you have any ideas how to make this work?

George
  • 177
  • 1
  • 12
  • first, u need to change ur library version from 1.17.0 to 1.15.0 implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.15.0' implementation 'com.google.ar.sceneform:assets:1.15.0' and why are you using the .gltf model? .gltf used when need to load model at runtime. try different models like .obj, fbx or sfb – Ahsan Syed Dec 04 '20 at 08:37
  • Thank you for your response. Why to fallback to 1.15? I mean, do I have to? And this is just a test. If I make this work, I will load models from server instead. So I need to work with gltf models. – George Dec 04 '20 at 08:55
  • coz ARCore is now open source and google is no longer maintaining a new version of ARCore that is: 1.17. and this version is not stable. got it? 1.15 is a stable version buddy. is ur code works now? – Ahsan Syed Dec 04 '20 at 11:10
  • Well, I did try to downgrade but I am still getting the same error "No RCB file at Uri". I think that sceneform requires a specific type of model and not just a model. Any ideas? Do you have to propose an alternative sdk for sceneform scene is it archived? – George Dec 06 '20 at 19:13
  • 1
    Well, actually I made it work after long time trying!! Had to open the model with Blender and export it from there! I do not know why this happens but this is the only way to make it work!! – George Dec 16 '20 at 11:52

1 Answers1

0

The obj format models still work fine with newer versions of arcore. If you "have 2 .gltf models" only, then I would think it would be much easier to convert your data. The obj format has been around since the 1980's and gltf format is so new it seems to be having growing-pains...

YinOrYan
  • 74
  • 5
  • Thank you for the answer. These 2 models are only for the proof of conept. Later on, there will be hundreds of models! I really try to figure what Google means when they say "gltf is supported" but no gltf model is actually playing. – George Dec 10 '20 at 16:05
  • That "gltf is supported" may be stale info. It looks like it may have been tossed overboard with Sceneform as implied here: https://stackoverflow.com/questions/62453399/google-sceneform-is-it-deprecated-any-replacement – YinOrYan Dec 10 '20 at 16:12