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

App crashes when using PlatformViewLink (but works with AndroidView) #11

Open
engor opened this issue Mar 1, 2024 · 1 comment
Open

Comments

@engor
Copy link

engor commented Mar 1, 2024

The SceneView widget is based on PlanformViewLink. And example app crashes after I turn on camera permission.

Device: Samsung Galaxy S10

Solution: replace PlatformViewLink with AndroidView (don't know about possible disadvantages):

return AndroidView(
  viewType: viewType,
  layoutDirection: TextDirection.ltr,
  creationParams: creationParams,
  creationParamsCodec: const StandardMessageCodec(),
  onPlatformViewCreated: onPlatformViewCreated,
);
@MustaphaELO
Copy link

Hello, Any updates here
i'm facing the same issue (i tested with three different physical android phones)
here is the thrown Exception:

FATAL EXCEPTION: main Process: io.github.sceneview.sceneview_flutter_example, PID: 16559 com.google.ar.core.exceptions.FatalException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at com.google.ar.core.Session.throwExceptionFromArStatus(Session.java:16) at com.google.ar.core.Session.nativeUpdate(Native Method) at com.google.ar.core.Session.update(Session.java:2) at io.github.sceneview.ar.arcore.ARSession.updateOrNull(ArSession.kt:102) at io.github.sceneview.ar.ARSceneView.onFrame(ARSceneView.kt:475) at io.github.sceneview.SceneView$FrameCallback.doFrame(SceneView.kt:695) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:997) at android.view.Choreographer.doCallbacks(Choreographer.java:797) at android.view.Choreographer.doFrame(Choreographer.java:728) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:984) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:8167) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

The proposed solution above (using AndroidView) works but it has limitation (example: app crashes while trying to rotate the phone to landscape , and other limitation i have faced while my integration)
Any updates would be appreciated, Thanks

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

2 participants