简体   繁体   English

Zendesk 和 Ionic -cordova-plugin-zendesk 不适用于 IOS

[英]Zendesk & Ionic - cordova-plugin-zendesk doesn't build for IOS

I have a hybrid app and I need to implement a Zendesk Tool there.我有一个混合应用程序,我需要在那里实现一个 Zendesk 工具。 There is a plugin that I thought that I am trying to use: https://github.com/fleetio/cordova-plugin-zendesk有一个我认为我正在尝试使用的插件: https://github.com/fleetio/cordova-plugin-zendesk

The problem is that I am able to make it work on Android but on IOS the build fails with an error:问题是我能够使其在 Android 上工作,但在 IOS 上,构建失败并出现错误:

/Users/ionic/builds/casasoft/jobmate-frontend/ios/capacitor-cordova-ios-plugins/sources/CordovaPluginZendesk/Zendesk.m:3:9: module 'ZendeskSDK' not found /Users/ionic/builds/casasoft/jobmate-frontend/ios/capacitor-cordova-ios-plugins/sources/CordovaPluginZendesk/Zendesk.m:3:9:找不到模块“ZendeskSDK”

I tried to provide the integrator using CocoaPods too according to what is written in the release notes and I am experimenting a lot trying to change some things but unfortunately without any success.根据发行说明中的内容,我也尝试使用 CocoaPods 提供集成器,并且我正在尝试很多尝试更改某些内容,但不幸的是没有任何成功。

I am completely out of ideas right now and I started to shoot in the dark but really nothing helps.我现在完全没有想法,我开始在黑暗中拍摄,但真的没有任何帮助。

Was anyone using it on IOS before?之前有人在 IOS 上使用过它吗? I am trying to build with XCode 11 but even with XCode 10, the error is always the same, even with Appflow Service (Ionic product to build ios files).我正在尝试使用 XCode 11 构建,但即使使用 XCode 10,错误总是相同的,即使使用 Appflow 服务(用于构建 Z9E304D4E8DF1B74CFAZ009913198428 文件的离子产品)。

What am I missing?我错过了什么? Do you have any idea what might be wrong?你知道可能出了什么问题吗? Maybe it rings a bell in someone's head... Thanks in advance.也许它在某人的脑海中敲响了警钟......在此先感谢。

That plugin uses cordova-plugin-cocoapods-support as a dependency to configure CocoaPods dependencies instead of using the official Cordova tags.该插件使用cordova-plugin-cocoapods-support作为依赖项来配置 CocoaPods 依赖项,而不是使用官方的 Cordova 标签。

Capacitor doesn't support those custom tags, there is an issue open for considering it, so add a +1 reaction if you are interested https://github.com/ionic-team/capacitor/issues/2773 Capacitor 不支持那些自定义标签,有一个问题需要考虑,所以如果您有兴趣,请添加 +1 反应https://github.com/ionic-team/capacitor/issues/2773

But the ideal fix would be for the plugin authors to move to the official syntax但理想的解决方法是让插件作者转向官方语法

I tried to investigate a bit on my own.我试着自己调查了一下。 Eventually, I was able to build on IOS but I did this only as an out-of-curiosity check.最终,我能够在 IOS 上进行构建,但我这样做只是出于好奇。

This is a sort of a workaround (with the 'official syntax' mentioned in the @jcesarmobile comment).这是一种解决方法(@jcesarmobile 评论中提到的“官方语法”)。

This is not a fully solved problem and I am not an IOS developer so I am not sure if this code makes 100% sense (but it worked).这不是一个完全解决的问题,我不是 IOS 开发人员,所以我不确定这段代码是否 100% 有意义(但它有效)。 I am just giving a hint here to everyone who may encounter a similar problem.我在这里只是给可能遇到类似问题的每个人一个提示。

In the plugin.xml在插件中.xml

1) removed this line 1)删除了这一行

<dependency id="cordova-plugin-cocoapod-support" />

2) inside 'platform name="ios" remove this line: 2) 在 'platform name="ios" 中删除这一行:

<pod name="ZendeskSDK" version="~> 3.0.1" />

3) instead of this deleted line (from point 2) paste this: 3)而不是这个删除的行(从第2点开始)粘贴这个:

 <podspec>
  <config>
    <source url="https://cdn.cocoapods.org/"/>
  </config>
  <pods>
    <pod name="ZendeskSDK" git="https://github.com/zendesk/zendesk_sdk_ios.git" branch="3.0.1-swift5.1-GM" />
  </pods>
</podspec>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM