Error while importing FBX with Import Sceneform Asset in Android Studio 3.6

There was a compatibility issue between android studio 3.6 and sceneform... So use this work around of manually generating the sfb file to solve compatible issues ..

Here is the FULL answer that will help anybody that's new to this and wanna use sceneform well without problems.

**

Step 1

. On the top left corner of your android studio sdk, Go to **File, Click Settings and search for plugins in the window that popups, and search for Sceneform in the online plugin marketplace step1

**

Step 2

**. Create a new folder and call it anything you like, For example i called this "sample_data"..step2

**

Step 3

**. Copy your 3D model source asset file (*.obj, *.fbx, or .gltf), and all of its dependencies (.mtl, *.bin, *.png, *.jpg, etc.) into the sampledata folder.

step3picture

**

Step 4

. Now paste this code format below **on the last line on your app's gradle build file in order to import MANUALLY and avoid any compatibility issues with the right-click method of importing which was seen in Android studio version 3.6... Of course dont forget to import lastest dependencies of Sceneform in your list of gradle dependencies

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',

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

Step 5

. Finally sync your gradle file and rebuild your project... Your SFb model would have been generated in the location you specified..


I had this problem and i tried adding the asset manually and it worked.

for example, I used the obj called andy_dance.fbx

so what I did was add this in the Gradle build

sceneform.asset('sampledata/models/andy_dance.fbx',
    'default',
    'sampledata/models/andy_dance.sfa',
    'src/main/assets/andy_dance',
    ['sampledata/models/andy_dance.fbx'])

run or build your app and hopefully, it'll work

Tags:

Android

Arcore