Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26697] Hyperloop: iOS - Cannot find classes from Swift frameworks

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-01-23T17:09:35.000+0000
Affected Version/sHyperloop 3.1.3
Fix Version/sHyperloop 4.0.1
ComponentsHyperloop, iOS
Labelsn/a
ReporterJan Vennemann
AssigneeJan Vennemann
Created2019-01-07T18:54:44.000+0000
Updated2019-01-23T17:09:35.000+0000

Description

*Steps to reproduce the behavior*

Use the following pod to install MTCircularSlider

install! 'cocoapods',
         :integrate_targets => false

use_frameworks!

platform :ios, '10.0'
target 'Hyperloop_Sample' do
	pod 'MTCircularSlider'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
      if ['MTCircularSlider'].include? target.name
          target.build_configurations.each do |config|
              config.build_settings['SWIFT_VERSION'] = '4.2'
          end
      end
  end
end

Use the slider view with Hyperloop

const MTCircularSlider = require('MTCircularSlider/MTCircularSlider');
const slider = new MTCircularSlider();
*Actual behavior* The app throws an error: Cannot find class with name: MTCircularSlider *Expected behavior* The app runs without errors. Note: MTCircularSlider is not ObjC compatible so any further usage of it is not possible.

Comments

  1. Jan Vennemann 2019-01-15

    PR: https://github.com/appcelerator/hyperloop.next/pull/314
  2. Richard Lustemberg 2019-01-16

    Please notice that in my case, I experience the same issue with an Obj C compatible framework (GiphyCoreSDK)
  3. Richard Lustemberg 2019-01-17

    Hi Jan, is it possible to get a hyperloop build with this commit?
  4. Jan Vennemann 2019-01-17

    You can check https://github.com/appcelerator-modules/hyperloop-builds/releases for the 4.0.1 release which includes this fix. However, on iOS Hyperloop 4.0.0 and above require SDK 8 so you have to test with a pre-release version. If you want to patch your local Hyperloop install, you can do that with a simple one liner. Assuming you are using Hyperloop 3.1.4 just replace line 91 in ~/Library/Application\ Support/Titanium/modules/iphone/hyperloop/3.1.4/hooks/generate/class.js with
       } else if (cls.filename && cls.filename.endsWith(cls.framework + '-Swift.h')) {
       
  5. Lokesh Choudhary 2019-01-17

    Verified the fix with Hyperloop 4.0.1. Followed the steps mentioned above & no error Cannot find class with name: MTCircularSlider is seen. Studio Ver: 5.1.2.201812191831 SDK Ver: 8.0.0.v20190117115226 OS Ver: 10.14 Xcode Ver: Xcode 10.1 Appc NPM: 4.2.13 Appc CLI: 7.0.10-master.5 Daemon Ver: 1.1.3 Ti CLI Ver: 5.1.1 Alloy Ver: 1.13.7 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 10.0.2 IOS Simulator: ⇨ iPhone XS (iOS 12.1)
  6. Richard Lustemberg 2019-01-18

    (y) :)

JSON Source