为设备构建时遇到错误 - 颤动

Posted

技术标签:

【中文标题】为设备构建时遇到错误 - 颤动【英文标题】:Encountered error while building for device - flutter 【发布时间】:2020-12-23 19:52:32 【问题描述】:

在 Flutter 中为 ios 设备构建时遇到错误,我尝试了很多方法,但还没有解决。 Flutter Firebase 项目会出现此问题,并且该版本被卡住了 4 天以上。请指导我尽快解决此问题

> Error output from Xcode build: ↳
>     2020-09-04 19:28:49.310 xcodebuild[12210:62950] warning:  The file reference for
> "Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h"
> is a member of
>     multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the
> membership in one of the groups will be preserved (but
>     membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another
> reference to the same path.
>     2020-09-04 19:28:49.310 xcodebuild[12210:62950] warning:  The file reference for
> "Objective-C/TOCropViewController/Views/TOCropOverlayView.h" is a
> member of multiple
>     groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the
> groups will be preserved (but
>     membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another
> reference to the same path.
>     2020-09-04 19:28:49.310 xcodebuild[12210:62950] warning:  The file reference for
> "Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h"
> is a member of
>     multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the
> membership in one of the groups will be preserved (but
>     membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another
> reference to the same path.
>     2020-09-04 19:28:49.310 xcodebuild[12210:62950] warning:  The file reference for
> "Objective-C/TOCropViewController/Views/TOCropScrollView.h" is a
> member of multiple
>     groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the
> groups will be preserved (but
>     membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another
> reference to the same path.
>     2020-09-04 19:28:49.310 xcodebuild[12210:62950] warning:  The file reference for "Objective-C/TOCropViewController/Views/TOCropToolbar.h"
> is a member of multiple groups
>     ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the
> groups will be preserved (but membership in
>     targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same
> path.
>     2020-09-04 19:28:49.310 xcodebuild[12210:62950] warning:  The file reference for "Objective-C/TOCropViewController/Views/TOCropView.h" is
> a member of multiple groups
>     ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the
> groups will be preserved (but membership in
>     targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same
> path.
>     2020-09-04 19:28:49.310 xcodebuild[12210:62950] warning:  The file reference for
> "Objective-C/TOCropViewController/TOCropViewController.h" is a member
> of multiple groups
>     ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the
> groups will be preserved (but membership in
>     targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same
> path.
>     2020-09-04 19:28:49.310 xcodebuild[12210:62950] warning:  The file reference for
> "Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h"
> is a member
>     of multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the
> membership in one of the groups will be preserved
>     (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another
> reference to the same path.
>     ** BUILD FAILED **
> 
> 
> Xcode's output: ↳
>     In file included from /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/FluttertoastPlugin.m:2:
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/UIView+Toast.h:328:19:
> warning: empty paragraph passed to '@param'
>     command [-Wdocumentation]
>      @param sharedStyle
>      ~~~~~~~~~~~~~~~~~^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/UIView+Toast.h:343:25:
> warning: empty paragraph passed to '@param'
>     command [-Wdocumentation]
>      @param allowTapToDismiss
>      ~~~~~~~~~~~~~~~~~~~~~~~^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/UIView+Toast.h:343:9:
> warning: parameter 'allowTapToDismiss' not found
>     in the function declaration [-Wdocumentation]
>      @param allowTapToDismiss
>             ^~~~~~~~~~~~~~~~~
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/UIView+Toast.h:343:9:
> note: did you mean 'tapToDismissEnabled'?
>      @param allowTapToDismiss
>             ^~~~~~~~~~~~~~~~~
>             tapToDismissEnabled
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/UIView+Toast.h:362:20:
> warning: empty paragraph passed to '@param'
>     command [-Wdocumentation]
>      @param queueEnabled
>      ~~~~~~~~~~~~~~~~~~^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/FluttertoastPlugin.m:20:23:
> warning: unused variable 'viewController'
>     [-Wunused-variable]
>         UIViewController *viewController =
>                           ^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/FluttertoastPlugin.m:99:21:
> warning: unused variable 'topPadding'
>     [-Wunused-variable]
>                 CGFloat topPadding = window.safeAreaInsets.top;
>                         ^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/FluttertoastPlugin.m:100:21:
> warning: unused variable 'bottomPadding'
>     [-Wunused-variable]
>                 CGFloat bottomPadding = window.safeAreaInsets.bottom;
>                         ^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/FluttertoastPlugin.m:73:19:
> warning: unused variable 'size'
>     [-Wunused-variable]
>             NSNumber *size = call.arguments[@"size"];
>                       ^
>     8 warnings generated.
>     In file included from /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/FluttertoastPlugin.m:2:
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/UIView+Toast.h:328:19:
> warning: empty paragraph passed to '@param'
>     command [-Wdocumentation]
>      @param sharedStyle
>      ~~~~~~~~~~~~~~~~~^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/UIView+Toast.h:343:25:
> warning: empty paragraph passed to '@param'
>     command [-Wdocumentation]
>      @param allowTapToDismiss
>      ~~~~~~~~~~~~~~~~~~~~~~~^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/UIView+Toast.h:343:9:
> warning: parameter 'allowTapToDismiss' not found
>     in the function declaration [-Wdocumentation]
>      @param allowTapToDismiss
>             ^~~~~~~~~~~~~~~~~
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/UIView+Toast.h:343:9:
> note: did you mean 'tapToDismissEnabled'?
>      @param allowTapToDismiss
>             ^~~~~~~~~~~~~~~~~
>             tapToDismissEnabled
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/UIView+Toast.h:362:20:
> warning: empty paragraph passed to '@param'
>     command [-Wdocumentation]
>      @param queueEnabled
>      ~~~~~~~~~~~~~~~~~~^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/FluttertoastPlugin.m:20:23:
> warning: unused variable 'viewController'
>     [-Wunused-variable]
>         UIViewController *viewController =
>                           ^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/FluttertoastPlugin.m:99:21:
> warning: unused variable 'topPadding'
>     [-Wunused-variable]
>                 CGFloat topPadding = window.safeAreaInsets.top;
>                         ^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/FluttertoastPlugin.m:100:21:
> warning: unused variable 'bottomPadding'
>     [-Wunused-variable]
>                 CGFloat bottomPadding = window.safeAreaInsets.bottom;
>                         ^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-7.0.4/ios/Classes/FluttertoastPlugin.m:73:19:
> warning: unused variable 'size'
>     [-Wunused-variable]
>             NSNumber *size = call.arguments[@"size"];
>                       ^
>     8 warnings generated.
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.16/ios/Classes/FLTFirebaseMessagingPlugin.m:195:43:
> warning:
>     'FIRMessagingRemoteMessage' is deprecated: FCM direct channel is deprecated, please use APNs for downstream message handling.
> [-Wdeprecated-declarations]
>     - (void)applicationReceivedRemoteMessage:(FIRMessagingRemoteMessage
> *)remoteMessage 
>                                               ^
>     In module 'FirebaseMessaging' imported from /Users/jimmy/Documents/firebaseproject/ios/Pods/Headers/Public/Firebase/Firebase.h:72:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/Public/FIRMessaging.h:219:1:
> note: 'FIRMessagingRemoteMessage' has been explicitly
>     marked deprecated here
>     __deprecated_msg(
>     ^
>     In module 'UIKit' imported from /Users/jimmy/Documents/firebaseproject/ios/Pods/Target Support
> Files/firebase_messaging/firebase_messaging-prefix.pch:2:
>     In module 'Foundation' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
>     In module 'CoreFoundation' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h
>     :6:
>     In module 'Darwin' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoun
>     dation.h:16:
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/cdefs.h:191:48:
> note: expanded from macro
>     '__deprecated_msg'
>             #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
>                                                           ^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.16/ios/Classes/FLTFirebaseMessagingPlugin.m:307:24:
> warning:
>     'FIRMessagingRemoteMessage' is deprecated: FCM direct channel is deprecated, please use APNs for downstream message handling.
> [-Wdeprecated-declarations]
>         didReceiveMessage:(FIRMessagingRemoteMessage *)remoteMessage 
>                            ^
>     In module 'FirebaseMessaging' imported from /Users/jimmy/Documents/firebaseproject/ios/Pods/Headers/Public/Firebase/Firebase.h:72:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/Public/FIRMessaging.h:219:1:
> note: 'FIRMessagingRemoteMessage' has been explicitly
>     marked deprecated here
>     __deprecated_msg(
>     ^
>     In module 'UIKit' imported from /Users/jimmy/Documents/firebaseproject/ios/Pods/Target Support
> Files/firebase_messaging/firebase_messaging-prefix.pch:2:
>     In module 'Foundation' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
>     In module 'CoreFoundation' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h
>     :6:
>     In module 'Darwin' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoun
>     dation.h:16:
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/sys/cdefs.h:191:48:
> note: expanded from macro
>     '__deprecated_msg'
>             #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
>                                                           ^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.16/ios/Classes/FLTFirebaseMessagingPlugin.m:141:30:
> warning:
>     'shouldEstablishDirectChannel' is deprecated: FCM direct channel is deprecated, please use APNs channel for downstream message
> delivery. [-Wdeprecated-declarations]
>         [FIRMessaging messaging].shouldEstablishDirectChannel = true;
>                                  ^
>     In module 'FirebaseMessaging' imported from /Users/jimmy/Documents/firebaseproject/ios/Pods/Headers/Public/Firebase/Firebase.h:72:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/Public/FIRMessaging.h:283:56:
> note: 'shouldEstablishDirectChannel' has been
>     explicitly marked deprecated here
>     @property(nonatomic) BOOL shouldEstablishDirectChannel DEPRECATED_MSG_ATTRIBUTE(
>                                                            ^
>     In module 'UIKit' imported from /Users/jimmy/Documents/firebaseproject/ios/Pods/Target Support
> Files/firebase_messaging/firebase_messaging-prefix.pch:2:
>     In module 'Foundation' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
>     In module 'CoreFoundation' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h
>     :6:
>     In module 'Darwin' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoun
>     dation.h:16:
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/AvailabilityMacros.h:182:64:
> note: expanded from macro
>     'DEPRECATED_MSG_ATTRIBUTE'
>                 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
>                                                                    ^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.16/ios/Classes/FLTFirebaseMessagingPlugin.m:196:52:
> warning: 'appData' is
>     deprecated [-Wdeprecated-declarations]
>       [self didReceiveRemoteNotification:remoteMessage.appData];
>                                                        ^
>     In module 'FirebaseMessaging' imported from /Users/jimmy/Documents/firebaseproject/ios/Pods/Headers/Public/Firebase/Firebase.h:72:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/Public/FIRMessaging.h:226:62:
> note: 'appData' has been explicitly marked deprecated
>     here
>     @property(nonatomic, readonly, strong) NSDictionary *appData DEPRECATED_ATTRIBUTE;
>                                                                  ^
>     In module 'UIKit' imported from /Users/jimmy/Documents/firebaseproject/ios/Pods/Target Support
> Files/firebase_messaging/firebase_messaging-prefix.pch:2:
>     In module 'Foundation' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
>     In module 'CoreFoundation' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h
>     :6:
>     In module 'Darwin' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoun
>     dation.h:16:
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/AvailabilityMacros.h:180:60:
> note: expanded from macro
>     'DEPRECATED_ATTRIBUTE'
>             #define DEPRECATED_ATTRIBUTE        __attribute__((deprecated))
>                                                                ^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.16/ios/Classes/FLTFirebaseMessagingPlugin.m:306:1:
> warning: implementing
>     deprecated method [-Wdeprecated-implementations]
>     - (void)messaging:(FIRMessaging *)messaging
>     ^
>     In module 'FirebaseMessaging' imported from /Users/jimmy/Documents/firebaseproject/ios/Pods/Headers/Public/Firebase/Firebase.h:72:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/Public/FIRMessaging.h:253:1:
> note: method 'messaging:didReceiveMessage:' declared
>     here
>     - (void)messaging:(FIRMessaging *)messaging
>     ^
>     /Users/jimmy/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.16/ios/Classes/FLTFirebaseMessagingPlugin.m:308:63:
> warning: 'appData' is
>     deprecated [-Wdeprecated-declarations]
>       [_channel invokeMethod:@"onMessage" arguments:remoteMessage.appData];
>                                                                   ^
>     In module 'FirebaseMessaging' imported from /Users/jimmy/Documents/firebaseproject/ios/Pods/Headers/Public/Firebase/Firebase.h:72:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/Public/FIRMessaging.h:226:62:
> note: 'appData' has been explicitly marked deprecated
>     here
>     @property(nonatomic, readonly, strong) NSDictionary *appData DEPRECATED_ATTRIBUTE;
>                                                                  ^
>     In module 'UIKit' imported from /Users/jimmy/Documents/firebaseproject/ios/Pods/Target Support
> Files/firebase_messaging/firebase_messaging-prefix.pch:2:
>     In module 'Foundation' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
>     In module 'CoreFoundation' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h
>     :6:
>     In module 'Darwin' imported from
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoun
>     dation.h:16:
>     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/usr/include/AvailabilityMacros.h:180:60:
> note: expanded from macro
>     'DEPRECATED_ATTRIBUTE'
>             #define DEPRECATED_ATTRIBUTE        __attribute__((deprecated))
>                                                                ^
>     6 warnings generated.
>     6 warnings generated.
>     1 warning generated.
>     Failed to subset font; aborting.
> 
> 
>     Command PhaseScriptExecution failed with a nonzero exit code
>     note: Using new build system
>     note: Building targets in parallel
>     note: Planning build
>     note: Constructing build description
>     warning: Skipping duplicate build file in Copy Headers build phase:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h
> (in target 'TOCropViewController'
>     from project 'Pods')
>     warning: Skipping duplicate build file in Copy Headers build phase:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropOverlayView.h
> (in target 'TOCropViewController' from project
>     'Pods')
>     warning: Skipping duplicate build file in Copy Headers build phase:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h
> (in target 'TOCropViewController' from
>     project 'Pods')
>     warning: Skipping duplicate build file in Copy Headers build phase:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropScrollView.h
> (in target 'TOCropViewController' from project
>     'Pods')
>     warning: Skipping duplicate build file in Copy Headers build phase:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropToolbar.h
> (in target 'TOCropViewController' from project
>     'Pods')
>     warning: Skipping duplicate build file in Copy Headers build phase:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropView.h
> (in target 'TOCropViewController' from project 'Pods')
>     warning: Skipping duplicate build file in Copy Headers build phase:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/TOCropViewController.h
> (in target 'TOCropViewController' from project
>     'Pods')
>     warning: Skipping duplicate build file in Copy Headers build phase:
>     /Users/jimmy/Documents/firebaseproject/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h
> (in target
>     'TOCropViewController' from project 'Pods')
> 
> Encountered error while building for device.

【问题讨论】:

你做了flutter更新了吗?你有哪个版本的? @Hakiza Flutter 版本 1.20.3,dart 版本 2.9.2,是的,我做了 Flutter 更新 您找到解决方案了吗?如果是,请分享。 【参考方案1】:

Jimmy Anderson 运行flutter upgrade 后,您需要检查现有项目使用的dependencies 是否也是最新的。

version 1.20.1 出现同样的错误,解决方案是删除 Pods 文件夹,pubspec.lock 文件:

):完全清除所有指向链接的点:

flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec

):最后运行这些:

rm ios/Podfile
rm pubspec.lock
flutter run

如果有人有最新的答案,可以完成这个临时解决方案。

【讨论】:

【参考方案2】:

这些步骤帮助我解决了类似问题

    首先尝试按照以下步骤构建 android 版本
删除pubspec.lock文件 flutter clean(在你的项目目录中) flutter pub get flutter build apk --release

然后我看到我的 Android 构建失败,这是一些与依赖相关的问题,我修复了这些问题。然后重复上面的步骤1。之后我的Android构建成功了。

    然后尝试按照以下步骤进行 iOS 构建
删除了ios目录中的Pods文件夹 删除了ios目录下的Podfile.lock文件 cd ios pod install pod update cd .. flutter clean flutter pub get flutter build ios --release

然后我的 iOS 构建成功了

【讨论】:

【参考方案3】:

这些步骤对我有用:

    运行flutter build 打开 Xcode (Runner.xcworkspace) 转到产品 -> 清理构建文件夹 在真机上运行 然后再试一次 - flutter build ios

【讨论】:

以上是关于为设备构建时遇到错误 - 颤动的主要内容,如果未能解决你的问题,请参考以下文章

Flutter 构建 iOS 错误:在 iOS 设备中构建 Flutter 应用程序时遇到错误

构建失败并出现异常 - 颤动

android 构建失败 - 颤动

出现错误时如何在颤动中更改背景颜色文本框?

颤动的firebase错误“失败:构建失败并出现异常”

发布构建失败颤动