[TIMOB-23780] Hyperloop: iOS - Build should copy Cocoapods-provided Bundles into the app.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-01-05T22:25:37.000+0000 |
Affected Version/s | hyperloop 1.2.5 |
Fix Version/s | Hyperloop 2.0.1 |
Components | Hyperloop, iOS, Tooling |
Labels | cocoapods, hyperloop, ios, qe-hyperloop |
Reporter | Rodolfo Perottoni |
Assignee | Jan Vennemann |
Created | 2016-08-12T03:50:40.000+0000 |
Updated | 2017-01-24T00:31:38.000+0000 |
Description
Some obj-c libraries require external bundles to work.
Google VR SDK is an example: if you download it with Cocoapods (*pod 'GVRSDK'*), you get all the necessary headers + a few *.bundle* files inside *Pods//Resources*. If you try and run an app with it you'll see an error like this:
[DEBUG] 2016-08-12 10:20:38.475 loopmodules-googlevr[48694:3058797] Failed to load font: file not found at file:///Users/rodolfo/Library/Developer/CoreSimulator/Devices/72A6BC5A-112B-4499-909B-4BECED0F1262/data/Containers/Bundle/Application/68A6B27F-6964-4991-AAFF-9B09CF6592AC/loopmodules-googlevr.app/MaterialRobotoFontLoader.bundle/Roboto-Medium.ttf
I've opened the location above and couldn't see any of the Bundles there.
*How to solve the issue:*
Manually copying the *.bundle* files to the */app/assets* folder solve this issue.
It would be nice if those bundles were automatically copied to the app to prevent these issues.
I am able to reproduce this issue on: Appc CLI NPM: 4.2.7 Appc CLI Core: 5.4.0 Arrow: 1.8.2 SDK: 5.4.0.GA Node: v4.4.7 Cocoapods: 1.0.1 OS: Mac OS X (10.11.6) Xcode: 7.3.1 Device: iphone 6 plus (9.3.4)
[~rdperottoni] Are CocoaPods assets always in
Pods/<podname>/Resources
?I can't guarantee that all of them work this way... I'd be shooting my own foot
I checked it. Pods can define the resources directors in their podspec file which would need to be checked for that.
PR (master): https://github.com/appcelerator/hyperloop.next/pull/98 PR (2_0_X): https://github.com/appcelerator/hyperloop.next/pull/100
PR (2_0_X): https://github.com/appcelerator/hyperloop.next/pull/113 The original PR for the 2_0_X branch contains a bug with a wrong variable name. The above PR fixes this bug.
Patch approved & merged! Please also update the Releases tab for QE, thx!
[2.0.1 Beta](https://github.com/appcelerator/hyperloop.next/releases/tag/2.0.1-beta) release updated on Github!
Verified as fixed,
Bundles
are now copied into the built application. *App.js* {noformat} var CGRectZero = require('CoreGraphics').CGRectZero; var GVRCardboardView = require('GVRSDK/GVRCardboardView'); var cardboardView = GVRCardboardView.alloc().initWithFrame(CGRectZero); {noformat} *Podfile* {noformat} install! 'cocoapods', :integrate_targets => false platform :ios, '7.0' target 'timob23780' do pod 'GVRSDK' end {noformat} *Tested on:* {noformat} macOS Sierra 10.12.2 iPhone 6 iOS simulator (10.2, 10.0) Ti SDK: 6.1.0.v20170123141052 Hyperloop: 2.0.1 Appc CLI: 6.1.0 Appc NPM: 4.2.8 Node v4.6.0 CocoaPods 1.0.1 {noformat} *Closing Ticket.*