5

I'm trying the new Sceneform SDK from Google for AR.

It says to use the Google Sceneform Tools plugin to import the assets. So I'm following all the steps mentioned here to import my assets.

While importing any 3D model (in .obj or .fbx format), everytime I get this error - error creating sfa with no other details of the error and then it gives an option to revert the process of asset importing.

I'm using Android Studio 3.1.2 and I'm on Linux OS (Ubuntu 18.04).

I have verified the steps again and again but everything looks fine. Anyone else facing this same issue ?

Asutosh Panda
  • 1,463
  • 2
  • 13
  • 25
  • Hi @Asutosh can you help me with this issue https://stackoverflow.com/questions/63900439/draw-renderable-shape-on-3d-model-using-sceneform-android I am stuck on this since last one month please let me know if you can help – Abhishek Sep 24 '20 at 15:34

8 Answers8

2

This solution on github helped me:

Link

1.right-click the 3D asset and select "Import Sceneform Asset"

2.click "finish"

3.click "keep broken gradle changes"

4.in the "gradle files have changed..." click "sync now" - the sync succeed, the .sfa file created in sampledata folder, and .sfb file created in assets folder

Koorosh
  • 457
  • 5
  • 14
  • Thanks for the effort. Till step 3, its fine. Even after doing step 4, the gradle is syncing fine without errors. But when I run the app, again its giving me - 'Error creating sfa.' – Asutosh Panda May 14 '18 at 16:35
  • So the issue is still there. – Asutosh Panda May 14 '18 at 16:35
  • Tried many things mentioned in this thread - https://github.com/google-ar/sceneform-android-sdk/issues/1 , still getting the same issue. Will wait till the bug gets fixed from the google team. – Asutosh Panda May 14 '18 at 17:02
2

I've fixed this error by removing 'mtllib xxxx.mtl' in the header of my obj file.

Hope it can help someone :)

EDIT I found the solution without removing something in the obj file. Just putting in the same folder the xxxx.mtl and the xxxx.obj

J. Joel
  • 21
  • 1
  • 4
  • Not working for me. But the Sceneform team is working to fix the issue on Linux. Its a compatibility problem on Linux. See here - https://github.com/google-ar/sceneform-android-sdk/issues/13 – Asutosh Panda May 16 '18 at 10:31
1

The issue is that the name of the .obj file is different from that of the .sfa and .sfb files, just rename the .obj file to the name you want and never touch the names of the .sfa and .sfb files.

Also make sure the .mtl file is associated with it.

Mohammad Elsayed
  • 1,885
  • 1
  • 20
  • 46
0

There's currently an issue created on Github for this. There's a compatibility issue with the converter in Ubuntu 18.04, but I'm not sure if it applies to other distros or older versions of Ubuntu.Issue 13

0

Google has now updated the Sceneform gradle plugin with the fix for this bug. Use version 1.0.1 of the Sceneform plugin.

In your project build.gradle file, replace this -

classpath 'com.google.ar.sceneform:plugin:1.0.0'

with this -

classpath 'com.google.ar.sceneform:plugin:1.0.1'

It should import your assets perfectly. It works for me now.

Asutosh Panda
  • 1,463
  • 2
  • 13
  • 25
0

Had the same error. It's not a glitch. I realized it was because the materials path in the obj file (line 1) was not correct. It still thought the name of the materials file was 'materials.mtl' when in fact I had renamed it to 'tree.mtl' (it was a model of a tree).

Lesson: don't rename the materials or texture files (unless you remember to change the paths inside the obj file).

0

The issue is because the sceneform.asset file has already been added to your module build.gradle. Below is an e.g of a sceneform.asset file in build.gradle

sceneform.asset('sampledata/andy.obj',
    'default',
    'sampledata/andy.sfa',
    'src/main/res/raw/andy')

and this will always give an error message that a task with such name already exists.

To solve the issue, remove the sceneform.asset file added to the Gradle and retry your sync and then re-import your .sfb file again.

Hope this solves the issue.

Peter Akwa
  • 77
  • 1
  • 6
0

It could be that you did not type your EXACT 3d file name on the .sfa path generation..

Go to the last line of your gradle file and Replace your file name in this code where i have written Your-3d-Model-file-Name here and try again generating your sfb file manually..

apply plugin: 'com.google.ar.sceneform.plugin', sceneform.asset('sample_data/Your-3d-Model-file-Name.obj',

'default', // 'Material Path' specified during import.

'sample_data/Your-3d-Model-file-Name.sfa', <--- This is where you could have made a mistake

'src/main/res/raw') // 'location you want to store the generated .sfb file'

step4pic

-

Finally sync your gradle file and rebuild your project... Your SFb model would have been generated in the location you specified.. For those still having issues, There was also a compatibility issue between android studio 3.6 and sceneform... So those that want a **full answer on how to generate sfb files should click here**

Samuel Ewudzi Incoom
  • 1,802
  • 17
  • 17