ios - 在iOS上运行Flutter项目时出现重新定义错误

标签 ios flutter

当我运行我的flutter项目时,连接了一个iOS设备,我会得到以下错误:

Xcode's output:
↳
    In file included from /REDACTED/flutter-app/ios/Pods/FirebaseStorage/Firebase/Storage/FIRStorage.m:20:
    In file included from /REDACTED/flutter-app/ios/Pods/FirebaseStorage/Firebase/Storage/Private/FIRStorageReference_Private.h:17:
    In file included from /REDACTED/flutter-app/build/ios/Debug-iphoneos/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageReference.h:19:
    In file included from /REDACTED/flutter-app/build/ios/Debug-iphoneos/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorage.h:19:
    /REDACTED/flutter-app/build/ios/Debug-iphoneos/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageConstants.h:80:28: error: redefinition of 'FIRStorageTaskStatus'
    typedef NS_ENUM(NSInteger, FIRStorageTaskStatus) {
                               ^
    In file included from /REDACTED/flutter-app/ios/Pods/FirebaseStorage/Firebase/Storage/FIRStorage.m:15:
    In file included from /REDACTED/flutter-app/ios/Pods/FirebaseStorage/Firebase/Storage/Public/FIRStorage.h:19:
    /REDACTED/flutter-app/ios/Pods/FirebaseStorage/Firebase/Storage/Public/FIRStorageConstants.h:80:28: note: previous definition is here
    typedef NS_ENUM(NSInteger, FIRStorageTaskStatus) {

据我所知,这是因为代码同时位于flutter runbuild/ios/Debug-iphoneos中。
如果我直接从Xcode运行我的项目,它将毫无问题地运行。
我的颤振医生输出:
[✓] Flutter (Channel master, v1.8.1-pre.22, on Mac OS X 10.14.5 18F132, locale en-DE)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✓] iOS tools - develop for iOS devices
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.4)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.1.3)
[✓] IntelliJ IDEA Community Edition (version 2019.1.3)
[✓] Connected device (3 available)

• No issues found!

最佳答案

要解决问题并能够运行项目,请运行flutter clean然后运行flutter run

关于ios - 在iOS上运行Flutter项目时出现重新定义错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56930849/

相关文章:

ios - 初始化 Facebook 实用程序

ios - 内存泄漏,MutableArray 中的对象没有释放?

ios - 奇怪的 iOS UIWebView 崩溃称为 WTF 崩溃

iOS Instagram - 如何在不登录的情况下获取公共(public)提要的访问 token

Flutter - 如何在 vscode 中过滤调试控制台

flutter - 以两个或多个为一组迭代列表

Flutter DataTable 选择行

flutter - flutter 朔迷离的嵌套列表与对象

ios - 实现 KIF 的示例

flutter - Flutter-如何控制圆形进度指示器的边框宽度?