微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Flutter - firebase_ml_vision - 不在 IOS 上构建 - textRecognizer 不起作用

如何解决Flutter - firebase_ml_vision - 不在 IOS 上构建 - textRecognizer 不起作用

Flutter - 试图让 SET_Object: async function(modelPath,texturePath) { // Clear out the scene for (let i = this.prodconf3_scene.children.length - 1; i >= 0; i--) { obj = this.prodconf3_scene.children[i]; this.prodconf3_scene.remove(obj); } const modelLoader = new THREE.GLTFLoader(); const textureLoader = new THREE.TextureLoader(); // Load texture const texture = await textureLoader.loadAsync(texturePath); texture.flipY = false; // Load model const { scene: model } = await modelLoader.loadAsync(modelPath); // Update model model.traverse((o) => { if (o.isMesh) { o.material.map = texture; o.material.needsUpdate = true; } }); this.prodconf3_obj = model; this.prodconf3_scene.add(this.prodconf3_obj); return this.prodconf3_obj; } 在 IOS 上工作

textRecognizer - 不是基于 IOS 构建

pubspec.yaml:

firebase_ml_vision

Podfile:

  firebase_core: ^0.7.0
  firebase_auth: ^0.20.1
  cloud_firestore: ^0.16.0+1
  firebase_storage: ^7.0.0
  firebase_ml_vision: ^0.10.0

运行# Uncomment this line to define a global platform for your project platform :ios,'10.0' # CocoaPods analytics sends network stats synchronously affecting Flutter build latency. ENV['COCOAPODS_disABLE_STATS'] = 'true' project 'Runner',{ 'Debug' => :debug,'Profile' => :release,'Release' => :release,} def Flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..','Flutter','Generated.xcconfig'),__FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually,make sure Flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FlutteR_ROOT\=(.*)/) return matches[1].strip if matches end raise "FlutteR_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig,then run Flutter pub get" end require File.expand_path(File.join('packages','Flutter_tools','bin','podhelper'),Flutter_root) Flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! Flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end post_install do |installer| installer.pods_project.build_configurations.each do |config| # Can be removed when moving to cocoapods 1.10 config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO' end installer.pods_project.targets.each do |target| Flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| # Inherit the deployment target defined in this Podfile instead,e.g. platform :ios,'11.0' at the top of this file config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' end end end

Flutter build ios

试过 <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORPrioritizer.h' [-Werror,-Wincomplete-umbrella] #import "Headers/GoogleDataTransport-umbrella.h" ^ <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORRegistrar.h' [-Werror,-Wincomplete-umbrella] <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORStorageEventSelector.h' [-Werror,-Wincomplete-umbrella] <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORPlatform.h' [-Werror,-Wincomplete-umbrella] <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORStorageProtocol.h' [-Werror,-Wincomplete-umbrella] <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORUploader.h' [-Werror,-Wincomplete-umbrella] <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORAssert.h' [-Werror,-Wincomplete-umbrella] <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORLifecycle.h' [-Werror,-Wincomplete-umbrella] <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORReachability.h' [-Werror,-Wincomplete-umbrella] <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORUploadPackage.h' [-Werror,-Wincomplete-umbrella] 10 errors generated. In file included from /Users/user924432/work/zapit/zapit/ios/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m:20: /Users/user924432/work/zapit/zapit/ios/Pods/FirebaseCoreDiagnostics/GoogleDataTransport/GDTCORLibrary/Internal/GoogleDataTransportInternal.h:18:9: Fatal error: Could not build module 'GoogleDataTransport' #import <GoogleDataTransport/GoogleDataTransport.h> ~~~~~~~^ While building module 'GoogleUtilities' imported from /Users/user924432/work/zapit/zapit/ios/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m:22: <module-includes>:1:1: error: umbrella header for module 'GoogleUtilities' does not include header 'GULLoggerCodes.h' [-Werror,-Wincomplete-umbrella] #import "Headers/GoogleUtilities-umbrella.h" ^ 1 error generated. 12 errors generated. Command CompileSwift Failed with a nonzero exit code Command CompileSwift Failed with a nonzero exit code note: Using new build system note: Building targets in parallel note: Planning build note: Constructing build description

pod update

解决方法

已解决:

pod deintegrate
pod update
flutter clean
flutter build ios

注意:虽然它编译了它仍然不起作用 - 见 https://github.com/FirebaseExtended/flutterfire/issues/5174

如果您使用的是设备上的 API 之一,请包含相应的 Podfile 中的 ML Kit 库模型。然后在 a 中运行 pod update 与您的 Podfile 位于同一目录中的终端。

仅供参考,目前将遇到 #4625 谢谢

https://github.com/FirebaseExtended/flutterfire/issues/4625

我能够通过以下方式让 textRecognizer 在 ios 上工作:

pubspec.yaml

  firebase_core: "^0.5.0"
  firebase_auth: ^0.18.1+1
  cloud_firestore: ^0.14.1+1
  firebase_storage: ^5.0.0-dev.2
  firebase_ml_vision: ^0.9.10

播客文件

pod 'Firebase/MLVision'
# If using an on-device API:
pod 'Firebase/MLVisionTextModel'

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。