【问题标题】:Flutter: AVCapturePhotoOutput' is only available on iOS 10.0 or newerFlutter:AVCapturePhotoOutput' 仅适用于 iOS 10.0 或更高版本
【发布时间】:2020-08-25 02:44:44
【问题描述】:

由于我在稳定通道上升级了 Flutter,我无法在 IOS 模拟器上运行。这是更新 Flutter 时经常出现的错误,尽管我进行了研究,但我找不到任何解决方案。我尝试删除 Podfile.lock,更新 pod 并重新安装,更改频道并升级,但总是出现相同的错误。

颤振医生:

[✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.15.3 19D76, locale en-FR)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.45.0)
[✓] Connected device (3 available)

• No issues found!

日志开始:

Xcode build done.                                           12.3s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    === BUILD TARGET gRPC-Core OF PROJECT Pods WITH CONFIGURATION Debug ===
    /Users/flo/.pub-cache/hosted/pub.dartlang.org/camera-0.4.3+2/ios/Classes/CameraPlugin.m:62:2
    4: warning: 'AVCapturePhotoOutput' is only available on iOS 10.0 or newer
    [-Wunguarded-availability]
    - (void)captureOutput:(AVCapturePhotoOutput *)output
                           ^
    In module 'AVFoundation' imported from
    /Users/flo/.pub-cache/hosted/pub.dartlang.org/camera-0.4.3+2/ios/Classes/CameraPlugin.m:2:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
    /iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureP
    hotoOutput.h:48:12: note: 'AVCapturePhotoOutput' has been marked as being introduced in iOS
    10.0 here, but the deployment target is iOS 8.0.0
    @interface AVCapturePhotoOutput : AVCaptureOutput

【问题讨论】:

    标签: ios xcode flutter


    【解决方案1】:

    我分享适用于需要它的人的解决方案:

    rm -rf ios/Podfile ios/Podfile.lock ios/Pods ios/Runner.xcworkspace
    

    【讨论】:

    • 我切换回master分支后遇到同样的问题,执行你提供的命令后仍然出现错误。
    • @HaifengZhang 我搬到了稳定频道(v1.17.0)。我想你已经执行了flutter clean,尝试在Xcode上清理构建文件夹-从你的flutter源文件夹中删除缓存
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多