Importing models using the Sceneform plugin on Android studio but getting 'error creating sfa'

10,456

Solution 1

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.

Solution 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

Solution 3

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

Solution 4

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.

Share:
10,456
Asutosh Panda
Author by

Asutosh Panda

Passionate Android developer. Problem solver. Believes in learning something new everyday. Loves trying cool and technically interesting new stuff.

Updated on June 25, 2022

Comments

  • Asutosh Panda
    Asutosh Panda almost 2 years

    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
    Asutosh Panda about 6 years
    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
    Asutosh Panda about 6 years
    So the issue is still there.
  • Asutosh Panda
    Asutosh Panda about 6 years
    Tried many things mentioned in this thread - 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
    Asutosh Panda about 6 years
    Not working for me. But the Sceneform team is working to fix the issue on Linux. Its a compatibility problem on Linux. See here - github.com/google-ar/sceneform-android-sdk/issues/13
  • Asutosh Panda
    Asutosh Panda about 4 years
    the question was already solved more than a year ago. see the answer below.