Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27757] watchOS: Frameworks are referenced incorrectly

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2020-07-29T23:17:09.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.1.0
ComponentsiOS
Labelsn/a
ReporterHans Knöchel
AssigneeChristopher Williams
Created2020-02-10T20:42:17.000+0000
Updated2020-07-29T23:17:09.000+0000

Description

When including native watchOS frameworks (and the build doesn't fail because of TIMOB-27756), the build later fails because the source files cannot find the frameworks. After some research, I found out that the frameworks are linked incorrectly, although linked correctly in the source project. It seems like a simple path issue somewhere, but it nukes the frameworks and marks them with a white icon (showing that they cannot be found). The issue can be reproduced in our app. *EDIT*: I found the reason:
Current pbxproj line (invalid):

		3A870A3023F1EE1600E07E86 /* MyFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = MyFramework.framework; sourceTree = "<group>"; };

should be:

		3A39B9AF23F2AE7800FF2AC3 /* MyFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MyFramework.framework; path = extensions/my_watch_app/MyFramework.framework; sourceTree = "<group>"; };
The pbxproj entry is missing the „name“ and „path“. Also, there is a missing framework search path $(PROJECT_DIR)/extensions/my_watch_app which should be added when the other refs are written. The issue behind it is that frameworks are stored at different subdirectories when copied from /extensions/xxxx to /build/iphone/extensions/xxxx but the path is not updated. A workaround is to hardcode the following hacky code below [these lines](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L3411):
const currentFileRef = Object.assign({}, xobjs.PBXFileReference[extFrameworkReference]);

if (!currentFileRef.path.includes('extensions/') && currentFileRef.sourceTree === '"<group>"') {
    xobjs.PBXFileReference[extFrameworkReference].path = extensions/MyExtensionName/${currentFileRef.path};
    xobjs.PBXFileReference[extFrameworkReference].name = currentFileRef.path;
}

Comments

  1. Hans Knöchel 2020-05-17

    PR: https://github.com/appcelerator/titanium_mobile/pull/11708
  2. Satyam Sekhri 2020-06-12

    FR Passed
  3. Satyam Sekhri 2020-07-29

    Verified on: Mac OS: 10.15.4 SDK: 9.1.0.v20200727104531 Appc CLI: 8.1.0-master.7 JDK: 11.0.4 Node: 10.17.0 Studio: 6.0.0.202005141803 Xcode: 12.0 beta Device: iOS simulator 13.5

JSON Source