【问题标题】:error: could not build Objective-C module 'agora_rtc_engine'错误:无法构建 Objective-C 模块“agora_rtc_engine”
【发布时间】:2021-06-21 12:28:49
【问题描述】:

跟进回购https://github.com/AgoraIO-Community/Agora-Flutter-Quickstart

无法使用以下规范在 macOS 上构建项目

Flutter 2.2.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d79295af24 (10 days ago) • 2021-06-11 08:56:01 -0700
Engine • revision 91c9fc8fe0
Tools • Dart 2.13.3

这是完整的错误堆栈

/.../.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-3.3.3/ios/Classes/Base/AgoraRtcEngineKit.h:9:9: error: 'AgoraRtcKit/AgoraRtcEngineKit.h' file not found
#import <AgoraRtcKit/AgoraRtcEngineKit.h>
        ^
<unknown>:0: error: could not build Objective-C module 'agora_rtc_engine'
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
/.../Agora-Flutter-Quickstart/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target
'AgoraRtcEngine_iOS' from project 'Pods')
/.../Agora-Flutter-Quickstart/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Flutter'
from project 'Pods')

【问题讨论】:

    标签: ios flutter dart


    【解决方案1】:

    我不确定这个解决方案是否适用于其他人,但这对我有用

    在这里https://github.com/AgoraIO-Community/Agora-Flutter-Quickstart/blob/master/pubspec.yaml#L21:L23

    将 Agora RTC 引擎版本和权限处理程序更改为

      agora_rtc_engine: ^4.0.1
      permission_handler: ^6.0.1
    

    然后执行以下操作

    • 删除 ios/Podfile.lock
    • 删除 Pods 文件夹
    • cd ios > pod install or pod install --repo-update
    • 删除 pubspec.lock
    • 删除构建文件夹
    • 运行flutter pub get

    如果还是不行

    rm -rf /YourUserPath/.pub-cache
    rm -rf ~/Library/Developer/Xcode/DerivedData
    rm ios/Podfile
    rm ios/Podfile.lock
    rm pubspec.lock
    rm -rf ios/Pods
    rm -rf ios/Runner.xcworkspace
    flutter clean
    flutter build ios
    flutter clean
    flutter run
    

    【讨论】:

      猜你喜欢
      • 2017-06-02
      • 1970-01-01
      • 1970-01-01
      • 2017-06-29
      • 2015-07-05
      • 2016-10-16
      • 2016-04-06
      • 2018-05-25
      相关资源
      最近更新 更多