0

更新到最新版本的cloud_firestore插件后(参见pubspec.yaml下文),应用程序将不再存档在最新的 Xcode 中,尽管它在模拟器上运行。

重现步骤

  1. 运行flutter build ios--> 确定

    在 Xcode 项目中使用指定开发团队自动签署 iOS 进行设备部署:xxxxxx

    运行 pod install... 10,8s

    运行 Xcode clean... 1,2s

    开始 Xcode 构建... ├─构建
    Dart 代码... 23,5s ├─组装 Flutter 资源... 2,1s └─编译、链接和签名... 83,3s Xcode 构建完成。

  2. 在 Xcode 中,Archive最终失败:

日志

While building module 'ProtoRPC' imported from /Users/sergebesnard/Development/Noteworthy/RoByN/app/ios/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h:21:
While building module 'GRPCClient' imported from /Users/sergebesnard/Library/Developer/Xcode/DerivedData/Runner-hizooagynttegaeqkhreoqwhrxzc/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/gRPC-ProtoRPC/ProtoRPC.framework/Headers/ProtoRPC.h:20:
While building module 'RxLibrary' imported from /Users/sergebesnard/Development/Noteworthy/RoByN/app/ios/Pods/gRPC/src/objective-c/GRPCClient/GRPCCall.h:36:
In file included from <module-includes>:1:
/Users/sergebesnard/Development/Noteworthy/RoByN/app/ios/Pods/Target Support Files/gRPC-RxLibrary/gRPC-RxLibrary-umbrella.h:23:9: error: include of non-modular header inside framework module 'RxLibrary': '/Users/sergebesnard/Library/Developer/Xcode/DerivedData/Runner-hizooagynttegaeqkhreoqwhrxzc/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/gRPC-RxLibrary/RxLibrary.framework/Headers/transformations/GRXMappingWriter.h' [-Werror,-Wnon-modular-include-in-framework-module]
#import "transformations/GRXMappingWriter.h"
        ^
1 error generated.
While building module 'ProtoRPC' imported from /Users/sergebesnard/Development/Noteworthy/RoByN/app/ios/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h:21:
While building module 'GRPCClient' imported from /Users/sergebesnard/Library/Developer/Xcode/DerivedData/Runner-hizooagynttegaeqkhreoqwhrxzc/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/gRPC-ProtoRPC/ProtoRPC.framework/Headers/ProtoRPC.h:20:
In file included from <module-includes>:1:
In file included from /Users/sergebesnard/Development/Noteworthy/RoByN/app/ios/Pods/Target Support Files/gRPC/gRPC-umbrella.h:13:
In file included from /Users/sergebesnard/Development/Noteworthy/RoByN/app/ios/Pods/gRPC/src/objective-c/GRPCClient/GRPCCall+ChannelArg.h:18:
/Users/sergebesnard/Development/Noteworthy/RoByN/app/ios/Pods/gRPC/src/objective-c/GRPCClient/GRPCCall.h:36:9: fatal error: could not build module 'RxLibrary'
#import <RxLibrary/GRXWriter.h>
 ~~~~~~~^
2 errors generated.
While building module 'ProtoRPC' imported from /Users/sergebesnard/Development/Noteworthy/RoByN/app/ios/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h:21:
In file included from <module-includes>:1:
In file included from /Users/sergebesnard/Development/Noteworthy/RoByN/app/ios/Pods/Target Support Files/gRPC-ProtoRPC/gRPC-ProtoRPC-umbrella.h:14:
/Users/sergebesnard/Library/Developer/Xcode/DerivedData/Runner-hizooagynttegaeqkhreoqwhrxzc/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/gRPC-ProtoRPC/ProtoRPC.framework/Headers/ProtoRPC.h:20:9: fatal error: could not build module 'GRPCClient'
#import <GRPCClient/GRPCCall.h>
 ~~~~~~~^
3 errors generated.
In file included from /Users/sergebesnard/Development/Noteworthy/RoByN/app/ios/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.m:17:
/Users/sergebesnard/Development/Noteworthy/RoByN/app/ios/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h:21:9: fatal error: could not build module 'ProtoRPC'
#import <ProtoRPC/ProtoService.h>
 ~~~~~~~^
4 errors generated.

颤振医生 -v ```

[✓] Flutter (Channel beta, v0.3.2, on Mac OS X 10.13.4 17E202, locale fr-BE)
    • Flutter version 0.3.2 at /Users/sergebesnard/Development/flutter
    • Framework revision 44b7e7d3f4 (4 weeks ago), 2018-04-20 01:02:44 -0700
    • Engine revision 09d05a3891
    • Dart version 2.0.0-dev.48.0.flutter-fe606f890b

[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/sergebesnard/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.3.1, Build version 9E501
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.0

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 24.2.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.23.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Dart Code extension version 2.12.1

[✓] Connected devices (1 available)
    • iPhone X • 780C4B10-21A6-41E0-9A05-A6175FC20FA0 • ios • iOS 11.3 (simulator)

! Doctor found issues in 1 category.

可能与这个问题有关

发布规范.yaml:

dependencies:


flutter:
    sdk: flutter
  google_sign_in: "^3.0.2"
  firebase_analytics: "^0.3.3"
  firebase_auth: "^0.5.10"
  firebase_database: "^0.4.6"
  firebase_storage: "^0.3.5"
  cloud_firestore: "^0.7.1"
4

4 回答 4

5

这适用于具有引用依赖项的基于 Objective-C 的 Flutter 项目,而我可以使用基于 Swift 的项目进行重现。

如果我修补 pod 伞头文件之一,Swift 错误就会消失:

Pods/gRPC-RxLibrary/Support files/gRPC-RxLibrary-umbrella.h

---遵循https://www.bountysource.com/issues/40110207-swift-could-not-build-modules-during-archiving-and-include-of-non-modular-header-inside-framework的建议-module-rxlibrary

于 2018-05-22T10:33:32.043 回答
3

gRPC 现在修复了在 xCode 中存档会崩溃的问题。如果你今天仍然有这个问题,这意味着你的 Pod 没有正确更新。

删除 /ios/Podfile.lock 和 /ios/Pods

这就是我最终让 gRPC 加载到最新版本的方式。gRPC 需要 1.13 或更高版本才能修复。

于 2018-09-02T16:45:08.510 回答
0

我遇到了同样的问题,并注意到使用(例如)构建时flutter build设置了一个BUILD_DIR标志。我将此添加到我的归档命令中并且它有效。source root/build/iosxcodebuildxcodebuild BUILD_DIR=/Users/example/projects/flutter_app/build/ios ...

¯\_(ツ)_/¯

于 2018-05-28T02:52:31.613 回答
0

我发现了问题,所有部署目标都必须相同。也就是说,在项目文件中,目标和 pod 的项目也是如此。

于 2019-08-21T09:57:23.140 回答