Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28155] iOS 14: Including module built with Xcode 12 causes deployment error

GitHub Issuen/a
TypeBug
PriorityCritical
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 9.2.0, Release 9.3.0, Release 9.2.1
Fix Version/sn/a
ComponentsiOS
Labelsios14, xcode12
ReporterHans Knöchel
AssigneeVijay Singh
Created2020-09-26T16:51:56.000+0000
Updated2020-11-05T14:50:54.000+0000

Description

When building a module (like our known friend [Ti.WidgetKit](https://github.com/hansemannn/titanium-widget-kit)) with Xcode 12 and deploying the parent app, the deployment fails. It can be reproduced with any sample project that includes the module!

Attachments

FileDateSize
app_extension_built_project.png2020-10-01T09:44:05.000+0000166928
app_extension_own_project.png2020-10-01T09:44:05.000+0000156372
WidgetKitTestApp.zip2020-10-08T06:37:07.000+0000136307

Comments

  1. Vijay Singh 2020-09-30

    [~hknoechel] Is it happening with this module only or any module built with Xcode 12 and titanium sdk 9.2.0.? And what are errors?
  2. Vijay Singh 2020-09-30

    [~hknoechel] There is an issue in your module. For TitaniumKit.xcframework 'Embed & Sign' is selected. It should be 'Do Not Embed'. To fix it - Open project in Xcode -> Select Target 'TiWidgetkit' -> General -> Frameworks and Libraries -> Select 'Do Not Embed' against Titaniumkit.xcframework. This should fix your issue. Let me know if it do not. Thanks! If you create new swift based module, Titaniumkit.xcframework is already 'Do Not Embed' in project.
  3. Hans Knöchel 2020-10-01

    Vijay, thank you so much for shedding a light on this! I applied your fix and it still shows an error during deployment (actually with one of our app extensions, though it works when not including WidgetKit). Have you tested the combination with app extensions already? You can also use our project to test if you want! *EDIT*: Looking at the archive, it seems like the build appends a "Frameworks/" folder to the app extension when including the module, but doesn't if the module is not included. *EDIT 2*: Digging further into it, I noticed that the build seems to override the Always Embed Swift Standard Libraries for all app extensions (like home extension, share extension), causing one of them to embed the Swift Standard Libraries (and the others not, because Xcode is smart enough to only embed them once). So once that's fixed, the module is likely ready to go. Especially, because the module works, if I manually delete the "Frameworks/" directory from the app extension inside the archive. I added two screenshots to show how the build settings are changed during the build
  4. Vijay Singh 2020-10-01

    [~hknoechel] I had tried by including the module only. It was not mentioned in ticket for inclusion of extension. I'll try with extensions.
  5. Hans Knöchel 2020-10-07

    Have you made any progress on that? We are happy to assist with sample code if necessary!
  6. Vijay Singh 2020-10-07

    Hey [~hknoechel] , I couldn't try due to other high priority issues and leaves. If you can share a small test case (which may have 1 extension), will be great.
  7. Hans Knöchel 2020-10-08

    Sure thing! I attached you a light classic project with one extension to reproduce the case. Simply change the app ID's of the extension and containing app to an app of yours, make a production build (ti build -p ios -T dist-appstore) and see the validation error + the Always Embed Swift Standard Libraries setting being changed.
  8. Vijay Singh 2020-10-08

    Thanks for sample app. I'll check it early next week and update you.
  9. Vijay Singh 2020-10-13

    [~hknoechel] I tried to build the shared project. It is building absolutely fine. I created production build and validated it from Xcode Organizer's 'Validate App'. It is not giving me any error. Though _Always Embed Swift Standard Libraries_ setting is getting changed but it is not causing any issue. Note - I used sdk 9.2.1.GA and Xcode 12.0.1 .
  10. Hans Knöchel 2020-11-05

    Thats very odd. Would you mind checking that on our app? Some config is changed by the build that causes this bug. Thank you Vijay! :-) *EDIT*: The "validate" step actually does not catch the error (!), only the upload *EDIT 2*: We can workaround the issue by injecting the following run phase:
        EXTRA_DIR="${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/PlugIns/MyActionExtension.appex/Frameworks"
        
        if [[ -d "${EXTRA_DIR}" ]]; then
          rm -rf "${EXTRA_DIR}"
        fi
        
    It seems like only action extensions are affected by it. Crazy.

JSON Source