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

这一生的挚爱 提交于 2020-05-23 08:54:24

问题


Im using a sceneform android sdk animation example project and am trying to import my own FBX for test. I add my fbx to sampledata/models and click on Import Sceneform Asset. Im getting an error ... "Gradle build failed with new import rules. Would you like to revert the changes?"

In the event log window I get Error: java.lang.RuntimeException: java.lang.NoSuchMethodError: com.android.tools.idea.templates.recipe.RecipeExecutor.append(Ljava/io/File;Ljava/io/File;)V

Im using Android Studio 3.6 Gradle 3.6.0 sceneform plugin 1.15

Any suggestion how to fix this would be welcomed


回答1:


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




回答2:


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

**

Step 2

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

**

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.

**

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'

Step 5

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



来源:https://stackoverflow.com/questions/60413649/error-while-importing-fbx-with-import-sceneform-asset-in-android-studio-3-6

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!