Log in or register to post comments

Model Target Crash

March 24, 2020 - 5:00am #8

Hi everyone, 

I'm new in AR and I'm testing Model Target functionality.

I created the dataset from Model Target Generator and imported it into Android Studio. The Guide Views are displayed correctly in the app, and the model is tracked correctly.

The problem is the crash of the app in the moment of rendering of my model. I have an "OutOfMemoryError" exception. I tried with 3D object with .obj and .v3d extension, but I have the same problems.

Next, the details of the error:

--------- beginning of crash

E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #4

    Process: com.vuforia.engine.CoreSamples, PID: 8460

    java.lang.RuntimeException: An error occurred while executing doInBackground()

        at android.os.AsyncTask$4.done(AsyncTask.java:399)

        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)

        at java.util.concurrent.FutureTask.setException(FutureTask.java:252)

        at java.util.concurrent.FutureTask.run(FutureTask.java:271)

        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)

        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.OutOfMemoryError: Failed to allocate a 701953607 byte allocation with 6275072 free bytes and 490MB until OOM, target footprint 28295840, growth limit 536870912

        at dalvik.system.VMRuntime.newNonMovableArray(Native Method)

        at java.nio.DirectByteBuffer$MemoryRef.<init>(DirectByteBuffer.java:70)

        at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:258)

        at com.vuforia.engine.SampleApplication.utils.SampleApplicationV3DModel.loadModel(SampleApplicationV3DModel.java:145)

        at com.vuforia.engine.CoreSamples.app.ModelTargets.ModelTargetRenderer$LoadModelTask.doInBackground(ModelTargetRenderer.java:237)

        at com.vuforia.engine.CoreSamples.app.ModelTargets.ModelTargetRenderer$LoadModelTask.doInBackground(ModelTargetRenderer.java:220)

        at android.os.AsyncTask$3.call(AsyncTask.java:378)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289) 

        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) 

 

How can I resolve?

 

Thank you

AttachmentSize
Image icon file.jpg32.57 KB

Model Target Crash

March 24, 2020 - 5:08am #7

Hi,

As per your description this seems to be similar to an issue that solved in 9.0.12.

Here are the release notes: https://library.vuforia.com/articles/Release_Notes/Vuforia-SDK-Release-Notes;

Could you please upgrade to our latest version, 9.0.12?

Thank you.

Vuforia Engine Support

Model Target Crash

March 24, 2020 - 6:20am #6

Hi,

Thank you for reply. I have updated at the latest SDK version 9.0.12, but the problem it's the same.

If I load the model "astronaut,v3d" or "drone.v3d", these are correctly rendered.

I tried with different 3D models and the result doesn't change. Is my 3D model file wrong?

Thank you

 

Domenico

Model Target Crash

March 24, 2020 - 6:48am #5

Hi,

Could you please confirm the size and polycount of the model?

Also are developing natively on Android or using Unity?

In addition, my recommendation when testing Model Target is to use the Model Target Test app.

download here: https://developer.vuforia.com/downloads/tool

How to use MT test app: https://library.vuforia.com/content/vuforia-library/en/articles/Solution/model-target-test-app-user-guide.html

Thank you.

Vuforia Engine Support

Model Target Crash

March 24, 2020 - 8:03am #4

Hi, 

the model is an .obj file with these characteristics:

  • Objects: 1
  • Vertices: 1099
  • Polygon: 83
  • Materials: 1
  • Bones: 1

I tried also to convert it to .v3d file, but the result is the same.

In addictions, I tried to load another model with these characteristics:

  • Objects: 1
  • Vertices: 16875
  • Polygon: 12615
  • Materials: 19
  • Bones: 1

For the loading of models, I used the same Class of Vuforia Sample example app. Naturally, I change the dataset with mine generated by Model Target Generator.

So, I changed only the assets resource file with mine dataset.

In this moment, I can't try Model Target Test app, because I don't have a physical devices where to install it.

I tried to install on Android Studio emulator by adb install, but the installation goes to failure.

 

In the file attached, there more information about models generated by Log. In this case, the model's information doesn't matching.

So, could it be a problem with my object file?

 

Thank you for all the information

 

Domenico

AttachmentSize
Image icon errato.png15.99 KB

Model Target Crash

March 25, 2020 - 2:58am #3

Hi,

The model should work without any issues. I believe the issue lies in modifying the native Android sample, my recommendation as mentioned earlier is to you use the MT Test app for loading your own model and testing the feature out.

Thank you.

Vuforia Engine Support

Model Target Crash

March 26, 2020 - 1:12am #2

Hi!

Thank you for the support. I tried the Model Target Test app and it tracks my model correctly as you can see in the attached photo.

So, the problem is "my" code. Can I load my 3D Model using ModelRenderable.builder() constructor in ar.sceneform ?

One last thing. Could you tell me, if these next steps are corrects for resoource's (3D Model) import in Android Studio?

  1. Copying model file in "sampledata" directory
  2. Right click on the resource and select "Import Asset Sceneform"
  3. Use of the file with .sfb extension to renderer

Thank you for all the support!

Domenico

AttachmentSize
Image icon ModelTargetTest1.jpg24.51 KB
Image icon ModelTargetTest.jpg91.79 KB

Model Target Crash

April 17, 2020 - 12:04pm #1

I tried to install on Android Studio emulator by adb install, but the installation goes to failure.

Log in or register to post comments