Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on Android (FEngine::loop) #473

Open
deviserandroid opened this issue Aug 13, 2024 · 0 comments
Open

Crash on Android (FEngine::loop) #473

deviserandroid opened this issue Aug 13, 2024 · 0 comments

Comments

@deviserandroid
Copy link

deviserandroid commented Aug 13, 2024

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant