Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24109] Not able to use Kinvey SDK as third party pod/framework

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2017-04-25T12:05:35.000+0000
Affected Version/shyperloop 1.2.8
Fix Version/sn/a
ComponentsHyperloop
Labelsn/a
ReporterShuo Liang
AssigneeEric Merriman
Created2016-11-07T06:06:25.000+0000
Updated2017-04-25T12:05:35.000+0000

Description

Customer is facing following problem, not able to use "Kinvey" as third party pod/framework.

Reproduce

1. Create a default app. 2. Add Podfile into project like following:
install! 'cocoapods', :integrate_targets => false
platform :ios, '10.0'
use_frameworks!

target 'AlloyHyperloop' do		
    pod 'Kinvey'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '3.0'
    end
  end
end
3. Add following code into app.js file
var APPKEY = 'kid_r1ME5mgA';
var APPSECRET = '9bef50c0843d4860984b543ea2fde4ff';

// ** This is regularly the username and password that is also used to log in to the app ** //
var USERNAME = 'cenciso';
var PASSWORD = 'cenciso';

try {
	var Kin = require('Kinvey/Kinvey');
	var Kinvey = new Kin();
	console.log('Kinvey: ' + JSON.stringify(Kinvey));
	Kinvey.sharedClient.initialize({
			appKey: APPKEY,
			appSecret: APPSECRET
	});
} catch (_error) {
	console.warn('- Error Loading Kinvey Module: ' + _error);
}
4. Run the app on simulator or device (iOS 10)

Problem.

App will crash.

Note

Customer confirmed with Kinvey's development team, they are able to using it in native code, and which is working well.

Attachments

FileDateSize
AlloyHyperloop_2016-11-07-132627_Appc-MBP.crash2016-11-11T00:59:41.000+00003573

Comments

  1. Hans Knöchel 2016-11-07

    I see a few issues with the example code, let me check the SDK and provide a full sample code that works. Please also attach full crash log, full environment e.g. Hyperloop version and SDK version.
  2. Shuo Liang 2016-11-17

    Any update?
  3. Chee Kiat Ng 2016-11-30

    Looking at the crash file, it seems to imply that KeychainAccess.framework is missing (which i assume is a 3rd party framework that came with the pod). So one possibility is to add this into appc.js. (assuming the framework is in a 'src' folder in project root)
       	hyperloop: {
       		ios: {
       			xcodebuild: {
       				/**
       				 * any flags available to be passed into the Xcode can be
       				 * included here to further customize the xcode build
       				 */
       				flags: {
       					FRAMEWORK_SEARCH_PATHS: '../../src'
       				},
       				frameworks: [
       					'KeychainAccess'
       				]
       			},
       			/**
       			 * optionally, you can bring in third-party or first-party libraries,
       			 * source code, resources etc. by including them here. The 'key' is the
       			 * name of the package that will be used in the require (if code).
       			 * the values can either be an Array or String value to the directory
       			 * where the files are located
       			 */
       			thirdparty: {
       				'KeychainAccess': {
       					// these can be an array or string
       					source: ['src'],
       					header: 'src',
       					resource: 'src'
       				}
       			}
       		}
       	}
       
    However, this is guesswork. Would prefer to have more information please.
  4. Shuo Liang 2017-03-23

    Any update?
  5. Jan Vennemann 2017-03-28

    [~sliang], the Kinvey SDK is written in Swift and therefore requires use_framework! directive. However, this is not supported by Hyperloop yet. The first iteration of this feature is planned for Hyperloop 2.1.0. Unfortunately i can't give an estimated release date for this at the moment, but they have several other options: * Kinvey has a SDK for Titanium at https://github.com/Kinvey/titanium-sdk which means it's not necessarily required to use Hyperloop to work with Kinvey * They can try using the 1.x version of the SDK, which is written in Objective-C, with pod 'KinveyKit'. Let me know if they have any other questions. If not i'll close this as a duplicate of TIMOB-23570.
  6. Shuo Liang 2017-03-28

    Thanks a lot. Will inform customer. Will notice you once get reply.
  7. Jan Vennemann 2017-04-25

    [~sliang], just in case you want an update for the customer: The fix for this is currently under review and set to be included in Hyperloop 2.2.0, not in 2.1.0 as i mentioned in my previous comment. For further updates please check TIMOB-23570 for which I'll close this as a duplicate of.

JSON Source