sceneform-android icon indicating copy to clipboard operation
sceneform-android copied to clipboard

Crash on Android (FEngine::loop)

Open deviserandroid opened this issue 1 year ago • 0 comments

Bug Description I am using the AR Core and ARScene to detect the surface and add Renderable Model on the surface. Most of the time, app crashes with logs added below.

Steps To Reproduce Steps to reproduce the behavior:

  1. Open the Ar Activity to detect the surfaces.
  2. When the surface is detected render a model on the surface.
  3. Things works just fine until user exists the ArActivity.
  4. Exit from the Ar Activity, and reopen the ArActivity to detect the surfaces. App will crash randomly while detecting the surface.

Logs --------- beginning of crash 14:07:01.885 A Cmdline: com.ardem.android 14:07:01.885 A pid: 27704, tid: 29291, name: binder:27704_7 >>> com.ardemo.android <<< ---------------------------- PROCESS STARTED (10050) for package com.ardemo.dev ---------------------------- 14:07:25.943 E Unknown restriction queried by uid 1000 (com.android.settings et al): com.ardemo.android 14:07:27.528 E package com.ardemo.android not found, can't check for attributionTag null 14:07:27.528 E Bad call made by uid 1000. Package "com.ardemo.android" does not belong to uid 10529. 14:07:27.546 E noteOperation java.lang.SecurityException: Specified package "com.ardemo.android" under uid 10529 but it is not at com.android.server.appop.AppOpsService.verifyAndGetBypass(AppOpsService.java:4856) at com.android.server.appop.AppOpsService.noteOperationUnchecked(AppOpsService.java:3496) at com.android.server.appop.AppOpsService.noteOperationImpl(AppOpsService.java:3484) at com.android.server.appop.AppOpsService.-$$Nest$mnoteOperationImpl(Unknown Source:0) at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher.lambda$noteOperation$4(AppOpsService.java:7832) at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher$$ExternalSyntheticLambda4.apply(Unknown Source:33) at com.android.server.policy.AppOpsPolicy.noteOperation(AppOpsPolicy.java:225) at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher.noteOperation(AppOpsService.java:7830) at com.android.server.appop.AppOpsService.noteOperation(AppOpsService.java:3468) at com.android.internal.app.IAppOpsService$Stub.onTransact(IAppOpsService.java:479) at android.os.Binder.execTransactInternal(Binder.java:1294) at android.os.Binder.execTransact(Binder.java:1253) 14:09:08.038 E Failed to measure fs-verity, errno 1: /data/app/~~bfJLQpoYd_PCDkdYOL9NVw==/com.ardemo.dev-9hOPHLRmcOps2im5cd6_LQ==/base.apk 14:12:48.130 E setOnBackInvokedCallback(): No window state for package:com.ardemo.dev 14:15:06.128 E setOnBackInvokedCallback(): No window state for package:com.ardemo.dev 14:15:13.522 A Cmdline: com.ardemo.dev 14:15:13.522 A pid: 3559, tid: 4949, name: FEngine::loop >>> com.ardemo.dev <<< 14:15:13.522 A #00 pc 0000000000124708 /data/app/~~bfJLQpoYd_PCDkdYOL9NVw==/com.ardemo.dev-9hOPHLRmcOps2im5cd6_LQ==/base.apk!libfilament-jni.so (BuildId: b0826f2754a95429ecf9e89c83684e184d383cff)

Android Device (please complete the following information):

  • Device: Pixel 3

  • OS: 13

  • Device: Motorola G62 5G

  • OS: 13

Additional context Code to load surface detection model `val bitmap = BitmapFactory.decodeResource(resources, R.drawable.surface)

    Texture.builder()
        .setSource(bitmap)
        .build().thenAccept { texture ->
            MaterialFactory.makeTransparentWithTexture(this, texture)
                .thenAccept { material: Material? ->
                    bitmap.recycle()

                    focusSquareModel = ShapeFactory.makeCylinder(0.1f, 0f, Vector3.zero(), material)
                    focusSquareModel!!.isShadowCaster = false
                    focusSquareModel!!.isShadowReceiver = false
                }
        }`

Code to load 3D Arrow Model `ModelRenderable.builder() .setIsFilamentGltf(true) .setAsyncLoadEnabled(true) .setSource(this, R.raw.target_model) .build() .thenAccept { modelRenderable -> modelRenderable?.isShadowCaster = false modelRenderable?.isShadowReceiver = false model = modelRenderable

        }
        .exceptionally { _ ->
            null
        }`

Things that I have tried so far:

  1. Detach the Anchors, release the renderable model, close the ARFragment's session when the ARActivity is destroyed.
  2. Comment out the code to observe the Scene's addOnUpdateListener that detects the surface and add Renderable model on the surface. Also comment the code to load the Model.

deviserandroid avatar Aug 13 '24 07:08 deviserandroid