2

我正在尝试将谷歌的 model_viewer 实现到我的应用程序中。在演示项目之后,我无法让它工作:

做:颤振运行:给出以下错误:

/Users/felixjungo/development/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-0.3.24/ios/Classes/FlutterWebView.m:367:23:警告:'mediaPlaybackRequiresUserAction'已弃用:首先弃用在 iOS 9.0 [-Wdeprecated-declarations] configuration.mediaPlaybackRequiresUserAction = true; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mediaTypesRequiringUserActionForPlayback 在从 /Users/felixjungo/development/flutter/.pub 导入的模块“WebKit”中-cache/hosted/pub.dartlang.org/webview_flutter-0.3.24/ios/Classes/FlutterWebView.h:6: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14。 5.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h:211:28:注意:'mediaPlaybackRequiresUserAction' 此处已明确标记为弃用 @property (nonatomic) BOOL mediaPlaybackRequiresUserAction API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(8.0, 9.0)); ^ /Users/felixjungo/development/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-0.3.24/ios/Classes/FlutterWebView.m:374:23:警告:'mediaPlaybackRequiresUserAction'已弃用:首先在 iOS 9.0 中已弃用 [-Wdeprecated-declarations] configuration.mediaPlaybackRequiresUserAction = false; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mediaTypesRequiringUserActionForPlayback 在从 /Users/felixjungo/development/flutter/.pub 导入的模块“WebKit”中-cache/hosted/pub.dartlang.org/webview_flutter-0.3.24/ios/Classes/FlutterWebView.h:6: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator。platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h:211:28:注意:“mediaPlaybackRequiresUserAction”已在此处明确标记为已弃用 @property (nonatomic) BOOL mediaPlaybackRequiresUserAction API_DEPRECATED_WITH_REPLACEMENT("mediaTypesRequiringUserActionForPlayback", ios(8.0, 9.0)); ^

model_viewer 取决于 webview_flutter ^0.3.22 所以我正在使用

颤振运行--no-sound-null-safety

由于 webview 小部件的旧版本而运行它。我收到以下错误:

Xcode 的输出:lib/main.dart:105:11: 错误:没有名为“src”的命名参数。src: 'https://modelviewer.dev/shared-assets/models/Astronaut.glb',

lib/main.dart:86:7:上下文:“ModelViewer”类有一个不带参数的构造函数。类 ModelViewer 扩展 StatelessWidget {

命令 PhaseScriptExecution 失败,退出代码为非零注释:使用新构建系统注释:并行构建目标注释:规划构建注释:分析工作空间注释:构建构建描述注释:构建准备完成 .../ios/Pods/Pods.xcodeproj:警告:iOS 模拟器部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 8.0,但支持的部署目标版本范围为 9.0 到 14.5.99。(在项目“Pods”的目标“Flutter”中)

pubspec.yalm:

环境:sdk:'>=2.12.0 <3.0.0'

依赖项:flutter:sdk:flutter model_viewer:^0.8.1


主要飞镖:

导入“包:model_viewer/model_viewer.dart”;


我可以强制 model_viewer 使用新版本的 webview 吗?有人知道可能是什么问题吗?如果我从代码中删除 ModelViewer 小部件,我不会收到任何错误,但将导入器留在那里。

model_viewer 是旧版

4

0 回答 0