2021年4月7日星期三

3D Model viewer not loading

I am using a flutter library called Model Viewer ModelViewer

That's a very nice plugin which works like charm on my dev version of that app. I am using it like this:

  ModelViewer(            backgroundColor: Colors.black,            src: 'assets/skull.glb',            alt: "A 3D model of a skull",            cameraControls: true,          ),  

And the .glb model is in the assets folder. My flutter is latest stable version as well as the version of this plugin.

The strange thing it that when I build the app bundle and publish the app on google play, when I navigate to the page with the model viewer the widget never loads.

I can only see a white screen.

Both the dev version and the release are tested on a physical device with android 10.

I am not sure how to debug this but would be happy for any suggestions. Can't find any solution from the original repo.

UPDATE

That's the error from the logcat:

2021-04-07 21:42:49.592 8121-8147/? E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: NoSuchMethodError: The getter 'address' was called on null.      Receiver: null      Tried calling: address      #0      _ModelViewerState.build.<anonymous closure> (package:model_viewer/src/model_viewer.dart:127)      #1      _ModelViewerState.build.<anonymous closure> (package:model_viewer/src/model_viewer.dart:125)      #2      _WebViewState._onWebViewPlatformCreated (package:webview_flutter/webview_flutter.dart:375)      #3      CupertinoWebView.build.<anonymous closure> (package:webview_flutter/src/webview_cupertino.dart:35)      #4      AndroidViewController.create (package:flutter/src/services/platform_views.dart:746)      <asynchronous suspension>      #5      RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:195)      <asynchronous suspension>  

Thank you.

https://stackoverflow.com/questions/66992871/3d-model-viewer-not-loading April 08, 2021 at 03:22AM

没有评论:

发表评论