[TIMOB-27757] watchOS: Frameworks are referenced incorrectly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-07-29T23:17:09.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.1.0 |
Components | iOS |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Christopher Williams |
Created | 2020-02-10T20:42:17.000+0000 |
Updated | 2020-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:
/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):
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
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;
}
PR: https://github.com/appcelerator/titanium_mobile/pull/11708
FR Passed
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