[TIMOB-24740] iOS - Unable to use Mapbox SDK (third-party framework) with Hyperloop
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2017-08-08T08:25:34.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Hyperloop |
Labels | Hyperloop, appcelerator, ios, mapbox, thirdparty |
Reporter | La Fabrik |
Assignee | Eric Merriman |
Created | 2017-05-25T21:47:44.000+0000 |
Updated | 2017-08-23T18:19:14.000+0000 |
Description
Hi,
I'm trying to use Hyperloop to integrate the mapbox framework to my app, but it is not working.
After following the appcelerator's guide for include third-party framework to ios, when I run the app on the ios simulator, the app crashes and I got a crash report (see attachments).
step to reproduce :
-create a new project in appcelerator using the default alloy project with hyperloop enabled.
-download the Mapbox iOS sdk at http://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-ios-sdk-3.5.4-dynamic.zip
-Unzip and place the Mapbox.framework file in "src" folder in the project's root directory
-I add an appc.js file on the project's root directory with those lines :
module.exports = {
hyperloop: {
ios: {
xcodebuild: {
flags: {
FRAMEWORK_SEARCH_PATHS: '../../src',
LD_RUNPATH_SEARCH_PATHS: '@executable_path'
},
frameworks: [
'Mapbox'
]
},
thirdparty: {
'Mapbox': {
source: ['src'],
header: 'src',
resource: 'src'
}
}
}
}
};
-Add the "MGLMapboxAccessToken" key in the tiapp.xml
-Edit the index.js controler :
function doClick(e) {
alert($.label.text);
}
var MGLMapView = require('Mapbox/MGLMapView');
var map = new MGLMapView();
$.index.add(map);
$.index.open();
-run the app on iOS simulator
Attachments
File | Date | Size |
---|---|---|
mapboxtest_2017-05-26-084428_Julien.crash | 2017-05-25T21:45:56.000+0000 | 16203 |
Hello @emerriman , Have you got some news? Thanks,
Just a general note for who ever is working on this. This problem is because Hyperloop doesn't support embedded binaries. I was able to get Mapbox to work using some modification to ti.dynamiclib....
Hello @Dee Clawson Thanks for the reply, I already tried this solution but without success, can you post an example please?
Hey La Fabrik, Sorry no, our code contains some trade secrets. When ti.dynamiclib is properly modified it works perfect though, best of luck. I would suggest getting Matise's module to work first. https://github.com/MatiseAms/ti-mapbox-gl Once you understand it and how he set up dynamiclib it is pretty easy to get working.
Actually here you go:
Hey La Fabrik, I did you one better. I have made an example iOS project with it working. https://github.com/kdclaw3/hyperloop-mapbox
hi @Dee Clawson, Oh thank you, I'll try it asap!
Resolving issue since this was no Titanium related issue. Side-note: Hyperloop 2.2.0 and SDK 6.2.0 will have core-support for dynamic libraries, so hook won't be necessary anymore.
Closing ticket with regards to the above observations.