flutter - CocoaPods 找不到“edge_detection”构建颤振 iOS 应用程序的兼容版本
问题描述
在尝试为 iOS 构建颤振应用程序后,我收到以下错误:
$ flutter build ios --no-codesign
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.example.mmpgui for device (ios-release)...
Running pod install... 0,8s
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
...
[!] CocoaPods could not find compatible versions for pod "edge_detection":
In Podfile:
edge_detection (from `.symlinks/plugins/edge_detection/ios`)
Specs satisfying the `edge_detection (from `.symlinks/plugins/edge_detection/ios`)` dependency were found, but they required a higher
minimum deployment target.
...
Error output from CocoaPods:
[!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a
platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
首先,我尝试按照链接中的建议,通过将平台版本设置为 10.0 来更新 Pod 文件(ios/Pods/Pod)
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
现在它编译了,但我得到了很多编译错误:
$ flutter build ios --no-codesign
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.example.mmpgui for device (ios-release)...
Running pod install... 38.3s
Running Xcode build...
Xcode build done. 665.5s
Failed to build iOS app
Error output from Xcode build:
** BUILD FAILED **
...
error: the following command failed with exit code 0 but produced no further output
CompileC
/Users/administrator/Library/Developer/Xcode/DerivedData/Runner-gjlpspwywczpboarjfvvefatdons/Build/Intermediates.noindex/Pods.build/Release-iph
oneos/camera.build/Objects-normal/arm64/CameraPlugin.o
/Users/administrator/development/flutter/.pub-cache/hosted/pub.dartlang.org/camera-0.5.7+3/ios/Classes/CameraPlugin.m normal arm64 objective-c
com.apple.compilers.llvm.clang.1_0.compiler
/Users/administrator/development/flutter/.pub-cache/hosted/pub.dartlang.org/edge_detection-1.0.4/ios/Classes/HomeViewController.swift:29:49:
error: value of optional type 'UIImage?' must be unwrapped to a value of type 'UIImage'
var imagePath = saveImage(image:results.scannedImage)
^
/Users/administrator/development/flutter/.pub-cache/hosted/pub.dartlang.org/edge_detection-1.0.4/ios/Classes/HomeViewController.swift:29:49:
note: coalesce using '??' to provide a default when the optional value contains 'nil'
var imagePath = saveImage(image:results.scannedImage)
^
?? <#default value#>
/Users/administrator/development/flutter/.pub-cache/hosted/pub.dartlang.org/edge_detection-1.0.4/ios/Classes/HomeViewController.swift:29:49:
note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
var imagePath = saveImage(image:results.scannedImage)
颤振医生显示以下内容:
$ flutter doctor -v
[✓] Flutter (Channel master, v1.15.3-pre.37, on Mac OS X 10.14.6 18G3020, locale de-AT)
• Flutter version 1.15.3-pre.37 at /Users/sebastiankubeck/Software/flutter
• Framework revision 6dc3bfaa98 (2 days ago), 2020-02-07 18:28:02 -0800
• Engine revision 6158f03ef5
• Dart version 2.8.0 (build 2.8.0-dev.8.0 514a8d4c84)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/sebastiankubeck/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.8.4
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 40.2.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.41.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.8.0
[✓] Connected device (3 available)
• macOS • macOS • darwin-x64 • Mac OS X 10.14.6 18G3020
• Chrome • chrome • web-javascript • Google Chrome 80.0.3987.87
• Web Server • web-server • web-javascript • Flutter Tools
• No issues found!
该项目是用旧版本的颤振创建的,似乎 ios 目录没有正确更新。或者,可能是我的CocoaPods版本太新,所以我尝试了1.7.5,也没有成功。
解决方案
推荐阅读
- ios - Flutter iOS 分发给其他人后如何跟踪和查看崩溃
- lua - 如何抑制来自lua中popen的错误消息
- java - java - 同步和可变变量
- python - 更新 jinja2 中的请求参数
- javascript - 为什么 firebase serve 不工作但 firebase deploy 工作正常?
- reactjs - 反应路由器私有路由不重定向
- java - 从略微偏离的双精度数创建正确的 BigDecimals
- c# - 自定义渲染如何滚动和点击
- excel - 如果落在同一日期,则反转范围的值
- python - 如何在 python qt 设计器或 pyqt5 中添加 matplotlib 3d pyplot