Cordova-plugin-firebasex: 无法在IOS上进行编译-InAppMessagingDisplayResources.bundle丢失

创建于 2020-03-04  ·  71评论  ·  资料来源: dpa99c/cordova-plugin-firebasex

错误报告

当前行为:

创建产品构建(Ionic)时,它崩溃并显示:

error: Resource "/Users/rattkin/Library/Developer/Xcode/DerivedData/driverhood-fdggvwggwpvrhxbzlvxxdbhztdnu/Build/Products/Debug-iphonesimulator/FirebaseInAppMessaging/InAppMessagingDisplayResources.bundle" not found. Run 'pod install' to update the copy resources script.

The following build commands failed:
    PhaseScriptExecution [CP]\ Copy\ Pods\ Resources /Users/rattkin/Library/Developer/Xcode/DerivedData/driverhood-fdggvwggwpvrhxbzlvxxdbhztdnu/Build/Intermediates.noindex/driverhood.build/Debug-iphonesimulator/driverhood.build/Script-53D89128D701315A18804F16.sh

xcodebuild: Command failed with exit code 65

我在平台/ ios中执行了pod install ,但它没有任何改变。 荚repo update也这样做。

看起来像Firebase/InAppMessaging吊舱有问题吗?

预期行为:
它应该正确编译。

重现步骤:
ionic cordova build ios --prod

环境信息

Installed platforms:
  android 8.1.0
  browser 6.0.0
  ios 5.1.1
Available platforms: 
  electron ^1.0.0
  osx ^5.0.0
  windows ^7.0.0
  • 项目中安装的插件和版本(包括此插件)
call-number 0.0.2 "Cordova Call Number Plugin"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter"
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-facebook4 6.3.0 "Facebook Connect"
cordova-plugin-firebasex 8.1.1 "Google Firebase Plugin"
cordova-plugin-geolocation 4.0.2 "Geolocation"
cordova-plugin-googleplus 8.4.0 "Google SignIn"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-ionic-webview 4.1.3 "cordova-plugin-ionic-webview"
cordova-plugin-market 1.2.0 "Market"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-sign-in-with-apple 0.0.1 "cordova-plugin-sign-in-with-apple"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-x-socialsharing 5.6.4 "SocialSharing"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-deeplinks 1.0.20 "Ionic Deeplink Plugin"
uk.co.workingedge.phonegap.plugin.launchnavigator 5.0.4 "Launch Navigator"
  • 开发机器的操作系统和版本,例如
    mac OS 10.15.3卡塔利娜

_iOS构建问题:_

  • 节点JS版本
    v10.18.1
  • XCode版本
    11.3.1
Firebase SDK bug build issue ios

最有用的评论

好的,如上所述,现在有一个cli_build分支,从该分支中​​删除了有问题的Firebase SDK组件。 您可以直接从分支机构安装,或者有相关的并行NPM版本:

cordova plugin add [email protected]

现在在主要文档中对此进行了

master分支有一个相应的修补程序版本,它重新添加了Inapp Messaging组件,并打算从Xcode进行构建,直到新的cordova-ios版本解决了CLI生成问题为止:

    cordova plugin add [email protected]

所有71条评论

当我将cordova-plugin-firebasex版本恢复为8.0.1时可以使用。 最近发行版中的应用程序内消息支持必须已损坏。

也遇到同样的问题。 也尝试在我的CI版本的cocoapods准备阶段运行pod repo updatepod install ,但无济于事:

      - run:
          name: Ionic - Prepare Cordova iOS & CocoaPods Dependencies
          command: |
            ionic cordova prepare ios --confirm --no-build
            cd platforms/ios/
            pod dependencies
            ionic cordova plugin rm cordova-plugin-firebasex
            ionic cordova plugin add cordova-plugin-firebasex
            ionic cordova prepare ios --confirm --no-build
            pod repo update
            pod install

如上所示,使此插件正常工作是一项繁重的工作。 除非存在该插件,否则无法运行CocoaPods的pod dependencies ,但是该插件的初始安装失败,因为未正确安装CocoaPods。 因此,必须首先准备cordova平台并安装插件(处于失败状态),进行pod依赖,然后删除插件,将其添加回去,重新准备平台,现在看来pod repo update和然后运行pod install ...

必须有一个更简单的方法来使此插件正常工作... Oo

在完整的错误报告中:

PhaseScriptExecution [CP]\ Copy\ Pods\ Resources /Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/Script-4C9A577E4E098CD9C9C43025.sh (in target 'WICShopper' from project 'WICShopper')
    cd /Users/distiller/project/platforms/ios
    /bin/sh -c /Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/Script-4C9A577E4E098CD9C9C43025.sh
error: Resource "/Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Products/Release-iphonesimulator/FirebaseInAppMessaging/InAppMessagingDisplayResources.bundle" not found. Run 'pod install' to update the copy resources script.

运行推荐的命令pod install似乎没有任何效果。 我一直在寻找指定的.bundle文件,但在任何地方都找不到。 该插件似乎在最新版本中已损坏。

该捆绑包位于platform / ios / build目录中,但它是“扁平”的,而不是位于一个名为FirebaseMessaging或类似名称的子目录中。 就像是引用脚本的路径错误,或者捆绑软件未正确定位。

我曾尝试移回版本8.0.1,但仍然遇到构建问题。 当前的构建错误是这样,无论我是否运行pod install ,都会发生此错误:

PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/Script-6CDB74AC9D91AFB94F3486DA.sh (in target 'WICShopper' from project 'WICShopper')
    cd /Users/distiller/project/platforms/ios
    /bin/sh -c /Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/Script-6CDB74AC9D91AFB94F3486DA.sh
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

这个问题使我们陷于水深,无法继续发展。 我们有机会从插件作者那里获得一些见识吗?

我想清理并重置整个项目吗?

我们CI中的每一个构建都是干净的。 我们拉出仓库,然后运行必要的ionic / cordova命令以从头开始准备,安装插件等。 我们不签入平台或插件目录(我们坚持使用Cordova的原因之一,而不是移至Capacitor,因为Capacitor通常要求您摆弄低级的本机代码,最终不得不检查它全部在...安静。:P)

您是否正在使用用于XCode的现代构建系统或旧式构建系统? 您的项目中是否还有cordova-plugin-cocoapodsx? 它是在一段时间前删除的,如果仍然保留,可能会与某些内容发生冲突。

这是一个相对较新的项目,于去年下半年开始使用Ionic 4和Cordova9。它确实使用cocoapodsx。

该项目直到上周一直运作良好,然后突然中断。 我们一直在开发和部署内部版本数月,直到上周中旬。 唯一的变化似乎是FirebaseX。

我现在已经尝试了该插件的多个先前版本。 在开始摆弄CI脚本以尝试解决此问题之前,我已将其CI构建脚本恢复为以前的样子。 我们最初从去年11月开始使用该插件的v7.0.1版本。 我尝试了7.0.1、7.0.2、8.0.0和8.0.1。 所有这些版本均导致相同的错误:

CompileC /Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/Objects-normal/x86_64/FirebasePlugin.o /Users/distiller/project/platforms/ios/WICShopper/Plugins/cordova-plugin-firebasex/FirebasePlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'WICShopper' from project 'WICShopper')
    cd /Users/distiller/project/platforms/ios
    export LANG=en_US.US-ASCII
    /Applications/Xcode-11.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -target x86_64-apple-ios11.0-simulator -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/Users/distiller/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/distiller/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wunreachable-code -Wno-implicit-atomic-properties -Wno-objc-interface-ivars -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode-11.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote /Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/WICShopper-generated-files.hmap -I/Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/WICShopper-own-target-headers.hmap -I/Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/WICShopper-all-target-headers.hmap -iquote /Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/WICShopper-project-headers.hmap -I/Users/distiller/project/platforms/ios/build/emulator/include -I/Users/distiller/project/platforms/ios/build/emulator/usr/local/lib/include -I/Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/UninstalledProducts/include -I/Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/UninstalledProducts/iphonesimulator/include -I/Users/distiller/project/platforms/ios/build/emulator -I/Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/DerivedSources-normal/x86_64 -I/Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/DerivedSources/x86_64 -I/Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/DerivedSources -F/Users/distiller/project/platforms/ios/build/emulator -include /Users/distiller/project/platforms/ios/build/sharedpch/SharedPrecompiledHeaders/749132040139485224/WICShopper-Prefix.pch -MMD -MT dependencies -MF /Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/Objects-normal/x86_64/FirebasePlugin.d --serialize-diagnostics /Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/Objects-normal/x86_64/FirebasePlugin.dia -c /Users/distiller/project/platforms/ios/WICShopper/Plugins/cordova-plugin-firebasex/FirebasePlugin.m -o /Users/distiller/Library/Developer/Xcode/DerivedData/WICShopper-bvrgbdzwowyexyasjjjdflehrghx/Build/Intermediates.noindex/WICShopper.build/Release-iphonesimulator/WICShopper.build/Objects-normal/x86_64/FirebasePlugin.o
/Users/distiller/project/platforms/ios/WICShopper/Plugins/cordova-plugin-firebasex/FirebasePlugin.m:4:9: fatal error: 'Firebase.h' file not found
#import "Firebase.h"
        ^~~~~~~~~~~~

如果运行pod install ,则会收到先前报告的有关Podfile.lock和Manifest.lock丢失的错误。

我们完全死在这里。

经调查,似乎仅在通过CLI进行构建时(通过xcodebuild工具)才会发生此错误-从Xcode进行构建可以正常工作(因此-因为我一直在Xcode中进行构建-错过了此问题)。
为了进行比较,这里是(失败的)CLI构建控制台输出)(成功的)Xcode构建控制台输出

至于为什么会发生此错误,我目前不知道。
Inapp Messaging组件是通过合并PR#312来添加的,表面上是一个简单的添加-只是通过其Cocoapods参考添加了Firebase SDK组件,而没有相关的插件代码更改。
CLI构建失败,因为未找到InAppMessagingDisplayResources.bundle 。 这似乎是Firebase SDK的隐式组件(相对于此插件明确指定的内容)。
因此,从此插件中删除Firebase SDK的Inapp Messaging组件不足,插件似乎无法解决很多问题,这当然会失去相关的功能。

同时,解决方法是从Xcode而不是CLI进行构建。

我尝试更新podspec以引用Firebase SDK for iOS的最新v6.18.0版本,但是从CLI进行构建时仍然会出现此问题😞

我们没有选择在CI(连续集成)构建中使用XCode进行构建的选择。 它必须是命令行。 因此,这不是推荐的解决方案。 当前,旧版本和当前版本均已损坏。 我不知道这是否是因为Firebase SDK更新已经破坏了8.1.1之前的所有版本,还是其他原因...但是我们使用Firebase Analytics和Cloud Messaging,目前由于更改而停止了开发这里。

有什么方法可以使以前的版本8.0.1正常运行而不会遇到我上面发布的任何错误? 我们不需要应用内消息传递,但似乎8.0.1在命令行上的构建似乎不比8.1.1更好。

我尝试更新podspec以引用Firebase SDK for iOS的最新v6.18.0版本,但是从CLI进行构建时仍然会出现此问题😞

可以引用以前的版本吗? 我们是否有可能获得一个8.0.2,该版本引用了8.1.1之前可用的相同版本的SDK?

从CLI可以很好地构建v8.0.1-从我的构建中看到此控制台输出

正是Inapp Messaging组件的添加导致了iOS上的CLI构建问题。

行。 我必须找到并更新对firebasex插件的所有版本引用,并将它们设置为8.0.1,并在卸载后重新安装该插件时显式引用8.0.1(因为由于未安装Pod,插件的首次安装失败)已安装,但只有在安装插件后才能安装Pod ...),然后才能更新Pod,以使所有功能正常工作。 一旦在所有位置将所有版本号都明确配置为8.0.1,该构建程序终于开始工作。

TL; DR:如果使用CLI进行构建,则可以将引脚版本8.0.1保留下来,直到可以发布补丁程序来解决8.1.x的此问题为止。
如果使用Xcode构建,则可以更新到最新的v8.1.1

似乎此问题并非特定于此插件或它引用的Inapp Messaging SDK组件的特定版本:
我可以使用以下命令来重现cordova-plugin-firebase-inappmessaging的问题(将Firebase / InAppMessagingDisplay v 6.3.0引入):

cordova create test && cd test
cordova plugin add cordova-plugin-firebase-inappmessaging
cordova platform add ios
cordova build ios

哪个(如此控制台输出所示)失败并出现相同的错误:

error: Resource "/Users/dave/Library/Developer/Xcode/DerivedData/HelloCordova-gvppvcmxenjfsnfvmssmvbuwhnay/Build/Products/Debug-iphonesimulator/FirebaseInAppMessagingDisplay/InAppMessagingDisplayResources.bundle" not found. Run 'pod install' to update the copy resources script.

与该插件一样,在Xcode中成功构建

我已固定版本8.0.1,但仍然有错误-问题是找不到FirebaseCore.h (如#330所述)
看来这是标题或类似问题。 我正在运行的命令是:

xcodebuild -j "$(sysctl -n hw.ncpu)" \
           -project "platforms/ios/app.xcodeproj" \
           -scheme "app-scheme" \
           -configuration Release clean archive \
           -archivePath "platforms/ios/app.xcarchive" \
           PROVISIONING_PROFILE="$uuid_dbg" \
           CODE_SIGN_IDENTITY="$identity_dbg"

关于如何解决此问题的任何提示?

@ Javinator9889好像您是直接调用xcodebuild一样?

而不是通过Cordova CLI生成如下内容:

xcodebuild -workspace FirebaseTest.xcworkspace -scheme FirebaseTest -configuration Debug -sdk iphonesimulator -destination platform=iOS Simulator,name=iPhone 11 Pro Max build CONFIGURATION_BUILD_DIR=/Users/dave/Documents/projects/@scratch/cordova-plugin-firebasex-test/platforms/ios/build/emulator SHARED_PRECOMPS_DIR=/Users/dave/Documents/projects/@scratch/cordova-plugin-firebasex-test/platforms/ios/build/sharedpch

在这个插件的上下文中,我不能直接支持xcodebuild的直接调用,因为潜在的变化太多。

我可以说的是,示例项目通过Cordova CLI在v8.0.1上构建良好,而通过Xcode在v8.1.1上构建良好,因此可以将其用作工作参考。

@ dpa99c我将看看使用Cordova CLI的情况-预先感谢:)

@ dpa99c我是第一次进入Cordova-我从事一个项目已有一段时间了。

您介意我指导您如何使用Cordova CLI创建xcarchive吗?

cordova build ios --device --release
stat platforms/ios/<YourAppName>.xcarchive

@ dpa99c有效了😮

非常感谢<3

抱歉戳! 我认为我们可以通过使用XCode来解决此问题,但是是否计划解决此问题? 使用XCode进行构建比使用CLI采取的方式更多

@nnimis如果你遵循的对话,你可以看到你可以通过钉扎firebasex插件_v8.0.1_编译

此外,这是一项正在进行中的工作(不到一天前就已开放),可能会在可能时修复。 我鼓励您阅读整个问题,以解决可能的问题

我认为我们必须等待新版本的Firebase SDK或新版本的cordova / cordova-ios。 Cocoapods的支持仍然有些不稳定。

在此阶段,我不知道是什么原因造成的,因此在我确定原因之前,没有计划进行修复-如此处所示,此错误并非特定于此插件。
找到原因的任何帮助都可以更快地解决问题。

谢谢大家,不要着急,只是想知道是否计划在任何时候实施修补程序。
@ Javinator9889在我的情况下降级没有解决,抱歉

@nnimis您遇到了什么错误?

https://github.com/apache/cordova-ios/issues/659中概述了此问题的具体原因:

Cordova设置的CONFIGURATION_BUILD_DIR参数会覆盖特定的Pod特定值,以使构建成功,从而在Pod包含特定文件夹结构(例如Firebase Inapp Messaging Pod)时失败。

因此,例如,运行cordova build ios在我的环境中运行从xcodebuild联编命令platforms/ios/这些论点:

xcodebuild -workspace FirebaseTest.xcworkspace -scheme FirebaseTest -configuration Debug -sdk iphonesimulator -destination platform="iOS Simulator,name=iPhone 11 Pro Max" build CONFIGURATION_BUILD_DIR=/Users/dave/Documents/projects/cordova-plugin-firebasex-test/platforms/ios/build/emulator SHARED_PRECOMPS_DIR=/Users/dave/Documents/projects/cordova-plugin-firebasex-test/platforms/ios/build/sharedpch

如果我手动运行该命令但删除了CONFIGURATION_BUILD_DIR参数,则构建成功:

xcodebuild -workspace FirebaseTest.xcworkspace -scheme FirebaseTest -configuration Debug -sdk iphonesimulator -destination platform="iOS Simulator,name=iPhone 11 Pro Max" build SHARED_PRECOMPS_DIR=/Users/dave/Documents/projects/cordova-plugin-firebasex-test/platforms/ios/build/sharedpch

因此,这是当前版本的Cordova处理这些吊舱的错误。
当前无法告诉Cordova CLI忽略CONFIGURATION_BUILD_DIR参数,因此唯一的选择是直接在Xcode中构建或手动调用xcodebuild命令(从失败的输出中获取它)。 cordova build ios )并省略CONFIGURATION_BUILD_DIR参数

感谢您进行的详细调查,非常感谢。

8.01将其修复为本机运行(Ionic 3),并将构建时间从8.1.0(超过12分钟)大大减少到仅1-2分钟。

v9.0.0现在已经发布,可通过从此插件中删除Inapp Messaging SDK组件来解决此问题

不幸的是,并没有太大帮助。 现在的错误(在9.0.0中)切换为:

error: Resource "Build/Products/Debug-iphonesimulator/GoogleTagManager/TagManagerResources.bundle" not found. Run 'pod install' to update the copy resources script.

似乎是系统性的问题。

该死,我忘了PR#318添加了GoogleTagManager iOS组件。

cordova-ios平台确实增加了对Cocoapods的支持,这确实是一个系统性问题。 CLI生成系统不完全支持某些Pod所需的生成配置(如https://github.com/apache/cordova-ios/issues/659中所述)。

我(和其他人)现在正在生产中通过此插件使用GTM,因此也不能删除iOS的该组件(尽管它解决了CLI生成问题)。

我需要重新思考管理该策略的方法:当包含GTM和Inapp Messaging SDK组件时,在Xcode中构建就可以正常工作-正是Cordova CLI构建是问题所在,这是由于Cordova CLI中存在问题在iOS上构建流程。

因此,我建议创建此存储库的新分支- cli_build -专门删除两个平台的GTM和Inapp Messaging SDK组件(即使iOS是问题所在,Android可以通过CLI很好地构建,我也不会)想要创建跨平台的不一致)。 该分支将与master相同,并且将并行维护,但是npm版本将脱离master分支,因此将包含GTM和Inapp Messaging SDK组件。
因此,如果要使用Cordova CLI进行构建,则需要直接在项目中引用分支:

cordova plugin add https://github.com/dpa99c/cordova-plugin-firebasex#cli_build

如果并且当新版本的cordova-ios解决了包括诸如此类的某些Pod时引起的基本构建问题时,那些使用CLI构建的人可以切换回master分支。

这是我认为可以解决此问题的最佳方法-毕竟这是由Cordova CLI生成过程引起的,并且使用Xcode生成的效果很好-因此,我不希望将插件功能限制于能够从Xcode造福那些无法做到的人。

看来这是一个合理的解决方案,谢谢。 希望cordova-ios可以很快发布新版本,因为最近iOS方面出现了问题。

@ dpa99c您是否有可能将cli版本发布到npm标签? 我不知道npm标签有多灵活...我自己使用过alpha和beta,但从技术上讲,它们可以是任何东西。 如果您仍然可以在其他标签下将此模块的cli版本发布到此模块的官方npm,那就太好了。 希望这将使您可以使用带有替代后缀的相同版本(即8.2.0-cli与8.2.0),将cli版本发布在npm中的cli标签下,然后我们可以简单地更改我们使用的版本在package.json中将-cli添加到版本末尾。

@jrista好主意-我会调查一下

好的,如上所述,现在有一个cli_build分支,从该分支中​​删除了有问题的Firebase SDK组件。 您可以直接从分支机构安装,或者有相关的并行NPM版本:

cordova plugin add [email protected]

现在在主要文档中对此进行了

master分支有一个相应的修补程序版本,它重新添加了Inapp Messaging组件,并打算从Xcode进行构建,直到新的cordova-ios版本解决了CLI生成问题为止:

    cordova plugin add [email protected]

谢谢@ dpa99c! 很高兴替代版本的后缀起作用了! 棒极了!

@ dpa99c我已将cordova plugin add [email protected]到我的项目中,并且它在第一次为ios构建时起作用。 但是,如果我运行构建命令ionic cordova build ios ,再次出现错误,即找不到InAppMessagingDisplayResources.bundle。

@ PatrickJung94 [email protected]不包含对Inapp Messaging SDK组件的任何引用,因此我推测您在配置中某处引用了非CLI版本,这导致该版本被拉入。

检查项目配置文件以及plugins/cordova-plugin-firebasex/plugin.xml以查看项目中实际存在的版本。

@ dpa99c我改变<plugin id="cordova-plugin-firebasex" version="9.0.1"<plugin id="cordova-plugin-firebasex" version="9.0.1-cli"plugins/cordova-plugin-firebasex/plugin.xml和建设后,我仍然得到错误。 我还能寻找其他参考吗?

即使删除platforms/iospluginsnode_modules并使用npm install重新安装并再次使用ionic cordova build ios进行构建,问题仍然存在。

@ PatrickJung94也检查package.json 。 我将对所有项目文件进行递归文本搜索,以确保您没有错过任何文件。

@ dpa99c package.json具有以下条目: "cordova-plugin-firebasex": "^9.0.1-cli"尽管在package-lock.json中,我具有:

"cordova-plugin-firebasex": {
      "version": "9.0.1",
      "resolved": "https://registry.npmjs.org/cordova-plugin-firebasex/-/cordova-plugin-firebasex-9.0.1.tgz",
      "integrity": "sha512-VUFJjd7PLeeHQ6ZIbtjxGhTCUtKmWB4vhzl8QaJ0rUcr6rwhjE8FYg6n68MODaKlbSU1emlB2QcV8vvL354UCQ==",
      "requires": {
        "plist": "^3.0.1",
        "xcode": "^2.0.0",
        "xml-js": "^1.6.11"
      }
    }

删除锁定文件并再次运行npm install不会更新新生成的锁定文件。

@ PatrickJung94 ,尝试运行cmd ionic cordova plugin rm cordova-plugin-firebasex --force

然后,确保没有“ your_project_name / plugin / cordova-plugin-firebasex”文件夹。 如果仍然存在,我只是手动将其删除。

然后,运行ionic cordova plugin add [email protected]

之后,运行cmd npm install @ionic-native/firebase-x

之后,使用cmd ionic cordova plugin 。 它应该列出
cordova-plugin-firebasex 9.0.1-cli "Google Firebase Plugin"

您还应该检查“ your_project_name / plugin / cordova-plugin-firebasex / package.json”,因为9.0.1-cli将被全部引用...这就是您想要的。 最后,检查“ your_project_name / package.json”并查找cordova-plugin-firebasex": "^9.0.1-cli

然后,尝试再次使用sudo ionic cordova build ios构建您的应用程序。

嘿,

仅供参考,我遇到了同样的问题,并通过遵循@kennethtck说明+完全删除了ios平台>重新添加>删除插件>重新添加来解决:

cordova platform remove ios;
cordova platform add ios@latest;
cordova plugin remove cordova-plugin-firebasex;
cordova plugin add [email protected];

我遇到了类似的问题,并通过切换到9.0.1-cli版本解决了它们。

但是,这导致IOS的构建时间增加了400%以上(与插件的6.1.0版本相比)。 使用这两个版本编译示例应用程序时,我验证了类似的增加。

我注意到@patrickchoi的上述评论暗示版本8.0.1和

有人知道在最新版本的插件中是否有任何方法可以减轻构建时间的降低? 我意识到这可能不是插件本身的问题... Firebase sdk组件(??)的更多信息有没有办法在构建时进行调整(最好从设置/脚本/ cli驱动)?

我们有一个Cordova应用程序,但也正在为我们的iOS项目构建本机手表应用程序。 当想要捆绑到手表应用程序中时,尝试使用Cordova CLI来构建iOS时会遇到很多问题(由于CLI的限制,即在构建/存档过程中同时处理iOS和手表应用程序-如果我记得的话,特别是用于签名)。 因此,我们需要使用xcodebuild手动执行iOS app + watch构建。

我遇到了与该问题所描述的相同的构建错误,但最终使用以下方法使其起作用。

cd platforms/ios

xcodebuild -workspace PROJECTNAME.xcworkspace -scheme PROJECTNAME -configuration Release -destination generic/platform=iOS -archivePath PROJECTNAME.xcarchive archive SHARED_PRECOMPS_DIR=build/sharedpch ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=YES

# exportOptions.plist was generated using XCode (archive app)
cp ../../build/ios/exportOptions.plist .

xcodebuild -exportArchive -archivePath PROJECTNAME.xcarchive -exportOptionsPlist exportOptions.plist -exportPath build/device

我们正在使用此插件的v8.0.1。 尝试使用9.0.1-cli( error: Build input file cannot be found: gRPCCertificates-Cpp.bundle/gRPCCertificates-Cpp )时,我遇到了其他问题。

我知道我们的情况可能是独特的,但这也许可以在将来对其他人有所帮助。 谢谢!

@kennethtck我忘记告诉您我的同事已按照您的步骤解决了我们的问题。 感谢您提供的步骤!

@ dpa99c嗨,好像InAppMessaging和GoogleTagManager已从https://github.com/dpa99c/cordova-plugin-firebasex/commit/b21213f3cb4d461f87980694fb2a28692979979中的master合并回9.0.3-cli分支

@ dpa99c,@maxtacco,我也这样做。

`cd [MYPATH] /平台/ ios
/ bin / sh -c [MYPATH] / Library / Developer / Xcode / DerivedData / [APPNAME] -aanowkqndskebrfkxmvdfhcnksye / Build / Intermediates.noindex / [APPNAME] .build / Debug-iphonesimulator / [APPNAME] .build / Script-2DD7BADC130A1BDEF45FCB72。 SH
错误:找不到资源“ [MYPATH] /库/开发人员/Xcode/DerivedData/[APPNAME]-aanowkqndskebrfkxmvdfhcnksye/Build/Products/Debug-iphonesimulator/FirebaseInAppMessaging/InAppMessagingDisplayResources.bundle”。 运行“ pod install”以更新副本资源脚本。

*建立失败*

以下构建命令失败:
PhaseScriptExecution [CP]复制Pod资源[MYPATH] / Library / Developer / Xcode / DerivedData / [APPNAME] -aanowkqndskebrfkxmvdfhcnksye / Build / Intermediates.noindex / [APPNAME] .build / Debug-iphonesimulator / [APPNAME] .build / Script-2DDEF7BFC1302 .sh
(1次失败)
xcodebuild:命令失败,退出代码为65`

我正在使用Cordova Webpack插件,并且更喜欢使用CLI。

干杯!

*编辑*

我做了@ore​​nagiv的把戏,它奏效了。 好像回溯到[email protected]形成了我。 谢谢!

@ jh-gh可以更快地编译它吗? 对我来说,在Macbook Air 2012上,需要23分钟才能使用CLI(cordova run ios)启动! 而且它似乎总是可以重建所有内容。

干杯。

@Phrensoua不,我还没有找到使它在9.X流中更快编译的方法。 我现在仍然停留在8.0.1上,因为该版本仍可在ios中构建相当长的时间,而9.0.1-cli版本的构建时间却是该版本的4倍(没有尝试过任何更高版本的9.X版本)。 。

我注意到@patrickchoi的上述评论建议,构建时间的增加介于8.0.1和

打扰一下@ jh-gh您是否解决了这个问题,只是删除插件并以这种方式再次安装?

cordova plugin add [email protected]

科尔多瓦平台删除ios;
科尔多瓦平台添加ios @ latest;
cordova插件删除cordova-plugin-firebasex;
cordova插件添加[email protected];

谢谢@ore​​nagiv,这对我

@ jh-gh,谢谢您的答复。 就我而言,我决定暂时执行Xcode。 至少不会每次都重建...

干杯

我注意到@patrickchoi的上述评论建议,构建时间的增加介于8.0.1和

打扰一下@ jh-gh您是否解决了这个问题,只是删除插件并以这种方式再次安装?

cordova plugin add [email protected]

@ilclaudio我更新了package.json中的依赖版本,并进行了干净的构建(rm node_modules,npm安装,rm平台/插件,(离子)cordova构建ios)。

我遇到了类似的问题,并通过切换到9.0.1-cli版本解决了它们。

但是,这导致IOS的构建时间增加了400%以上(与插件的6.1.0版本相比)。 使用这两个版本编译示例应用程序时,我验证了类似的增加。

我注意到@patrickchoi的上述评论暗示版本8.0.1和

有人知道在最新版本的插件中是否有任何方法可以减轻构建时间的降低? 我意识到这可能不是插件本身的问题... Firebase sdk组件(??)的更多信息有没有办法在构建时进行调整(最好从设置/脚本/ cli驱动)?

我也遇到了9.1.1的构建问题,但使用9.1.1-cli的构建成功。 这些版本具有相同的构建时间问题。 大概需要15-20分钟。 所以我降级了8.0.1并在2-3分钟内完成了构建。 感谢您的测试和8.0.1提示。

@ore​​nagiv
思念!
离子Cordova插件添加

它工作完美,编译时间是当前唯一的问题

提示:请不要这样固定:
"cordova-plugin-firebasex": "^9.1.1-cli"
因为它将默认为非CLI。 直接使用。
"cordova-plugin-firebasex": "9.1.1-cli"

似乎很明显,但是今天我已经花了一些时间挠头,为什么它仍然引发旧错误。

使用CLI cordova run ios --device和Xcode进行构建之间有区别吗?

@sboudouk是,目前正在建设包含子文件夹(如谷歌标签管理器或火力地堡Inappmessaging)吊舱无法使用科尔多瓦CLI(如记录在这里),而它建立在Xcode的时候,因此需要设立一个工作正常-cli此插件的分支。

是否可以为包装提供“ latest-cli”标签?

你好

编译时,此插件在ios上存在很大问题。 我不想启动一个新线程,因为我不认为插件有问题,但与pods库有关。 它会生成一个生成错误,提示在构建的各个阶段磁盘已满。 我正在使用远程Mac服务器,他们的支持无法帮助我创建一个我可以做的新服务器,但我觉得这可能是同样的问题。 我认为这是ram磁盘已满的问题,因为此pod库非常庞大,会使编译时间花费更长的时间。 我在网上搜索了一些内容来解决此问题,从而清理了xcode构建等,但是我仍然无法创建此构建。 是否有人可以引导我找到解决方案,为什么会给出此错误以及我可以如何解决? 没有此插件,构建工作正常且快速

这是一个例子
错误:正在访问构建数据库
“ /Users/user915171/Library/Developer/Xcode/DerivedData/Astra-albjvigcqvqixkbzncjokuhaaees/Build/Intermediates.noindex/XCBuildData/build.db”:数据库或磁盘已满

有此问题的任何人,请添加以下具有相同版本的插件:
cordova-plugin-androidx-adapter 1.1.1
科尔多瓦插件Androidx 1.0.2
cordova-plugin-firebasex 9.0.1-cli

该插件需要cordova-plugin-androidx和cordova-plugin-androidx-adapter。

在cordova cli中有类似的问题。 但是,我无法通过更改为插件的任何-cli版本来解决它们。 或通过降级到以前为我工作的8.0.1。

无论我现在使用哪个版本的插件,我的构建始终都会失败并显示以下消息。 如果我完全删除插件,则构建成功。

即使使用-cli插件或8.0.1插件,也不确定这些Pod仍如何潜入我的构建中。 如果找到解决方案,将发布。 如果有人看到此问题,请告诉我。


在构建从/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22导入的模块“ nanopb”时:
在包含的文件中:1:
/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:13:9:错误:双引号包括框架标题中的“ pb.h”,预期角度括弧式代替[-Werror,-Wquoted-include-in-framework-header]

导入“ pb.h”

    ^~~~~~
    <pb.h>

/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:14:9:错误:在框架标题中双引号包括“ pb_common.h”,预期角度括弧式代替[-Werror,-Wquoted-include-in-framework-header]

导入“ pb_common.h”

    ^~~~~~~~~~~~~
    <pb_common.h>

在构建从/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22导入的模块“ nanopb”时:
在包含的文件中:1:
在/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:14中包含的文件中:
/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/nanopb/pb_common.h:8:10:错误:在框架标头中双引号包括“ pb.h”,用尖括号括起来[-Werror ,-Wquoted-include-in-framework-header]

包括“ pb.h”

     ^~~~~~
     <pb.h>

在构建从/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22导入的模块“ nanopb”时:
在包含的文件中:1:
/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:15:9:错误:在框架标题中双引号包括“ pb_decode.h”,预期角度括弧式代替[-Werror,-Wquoted-include-in-framework-header]

导入“ pb_decode.h”

    ^~~~~~~~~~~~~
    <pb_decode.h>

在构建从/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22导入的模块“ nanopb”时:
在包含的文件中:1:
在/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:15中包含的文件中:
/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/nanopb/pb_decode.h:9:10:错误:在框架标头中双引号包括“ pb.h”,应用尖括号括起来[-Werror ,-Wquoted-include-in-framework-header]

包括“ pb.h”

     ^~~~~~
     <pb.h>

在构建从/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22导入的模块“ nanopb”时:
在包含的文件中:1:
/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:16:9:错误:在框架标题中双引号包括“ pb_encode.h”,预期角度括弧式代替[-Werror,-Wquoted-include-in-framework-header]

导入“ pb_encode.h”

    ^~~~~~~~~~~~~
    <pb_encode.h>

在构建从/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22导入的模块“ nanopb”时:
在包含的文件中:1:
在/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:16中包含的文件中:
/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/nanopb/pb_encode.h:9:10:错误:在框架标头中双引号包括“ pb.h”,用尖括号括起来[-Werror ,-Wquoted-include-in-framework-header]

包括“ pb.h”

     ^~~~~~
     <pb.h>

在构建从/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22导入的模块“ nanopb”时:
在包含的文件中:1:
/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:17:9:错误:双引号包括框架标题中的“ pb.h”,预期角度括弧式代替[-Werror,-Wquoted-include-in-framework-header]

导入“ pb.h”

    ^~~~~~
    <pb.h>

/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:18:9:错误:在框架标题中双引号包括“ pb_decode.h”,预期角度括弧式代替[-Werror,-Wquoted-include-in-framework-header]

导入“ pb_decode.h”

    ^~~~~~~~~~~~~
    <pb_decode.h>

/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:19:9:错误:在框架标题中双引号包括“ pb_common.h”,预期角度括弧式代替[-Werror,-Wquoted-include-in-framework-header]

导入“ pb_common.h”

    ^~~~~~~~~~~~~
    <pb_common.h>

/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:20:9:错误:双引号包括框架标题中的“ pb.h”,预期角度括弧式代替[-Werror,-Wquoted-include-in-framework-header]

导入“ pb.h”

    ^~~~~~
    <pb.h>

/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:21:9:错误:在框架标题中双引号包括“ pb_encode.h”,预期角度括弧式代替[-Werror,-Wquoted-include-in-framework-header]

导入“ pb_encode.h”

    ^~~~~~~~~~~~~
    <pb_encode.h>

/ Users / haydencassar / Code / AppTemplate / frontend / platforms / ios / Pods / Target支持文件/nanopb/nanopb-umbrella.h:22:9:错误:在框架标题中双引号包括“ pb_common.h”,预期角度括弧式代替[-Werror,-Wquoted-include-in-framework-header]

导入“ pb_common.h”

    ^~~~~~~~~~~~~
    <pb_common.h>

产生13个错误。
在/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.c:20中包含的文件中:
/Users/haydencassar/Code/AppTemplate/frontend/platforms/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.h:22:10:致命错误:无法构建模块“ nanopb”

包括

~~~ ^
产生14个错误。

*归档失败*

以下构建命令失败:
CompileC /用户/ haydencassar /库/开发人员/Xcode/DerivedData/Vita_Plan-adyddjnjkyhpbddfhgtvyhypkbaq/Build/Intermediates.noindex/ArchiveIntermediates/Vita Plan / IntermediateBuildFilesPath / Pods.build / Debug-iphoneos / GooglesTransfert。 .nanopb.o GoogleDataTransport / GoogleDataTransport / GDTCCTLibrary / Protogen / nanopb / cct.nanopb.c普通armv7 c com.apple.compilers.llvm.clang.1_0.compiler
(1次失败)
xcodebuild:命令失败,退出代码为65
[错误]运行子进程cordova时发生错误。

    cordova build ios --debug --device --buildConfig ./platforms/ios/build.json exited with exit code 65.

@ hcassar93我也看到过类似的问题。 我建议您尝试将cocoapods安装升级到预发行版本(请参阅https://stackoverflow.com/questions/63646607/xcode-12-using-firebase-pods-lexical-or-preprocessor-issue-pb-h -file-not-fou / 63648164#63648164)。 这为我解决了。

@ jh-gh非常感谢。 非常感谢您的帮助。 也为我修复了它。

将插件版本固定在8.0.1也对我有用。 从CLI和CI构建。

此页面是否有帮助?
0 / 5 - 0 等级