Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23729

Hyperloop: iOS: Local-embedded frameworks not working with TICORE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 5.4.0
    • Component/s: Hyperloop, iOS
    • Labels:
      None
    • Environment:

      appc cli 5.4.0-37
      appc npm 4.2.7
      Hyperloop Module 1.2.5
      Ti SDK : 5.4.0.v20160802165655

    • Story Points:
      8
    • Sprint:
      2016 Sprint 16 SDK

      Description

      Just found out that local frameworks will get a build failure if <use-jscore-framework>false</use-jscore-framework>

      You are going to need this framework and this tessdata.
      https://github.com/gali8/Tesseract-OCR-iOS
      https://github.com/tesseract-ocr/tessdata

      or look for Josh Longton.

      Steps to reproduce

      1. appc new --classic
      2. install the packaged hyperloop module here: https://github.com/appcelerator/hyperloop.next/releases/tag/1.2.5
      3. in tiapp.xml include

      <ios>
      	<use-app-thinning>false</use-app-thinning>
      	<use-jscore-framework>false</use-jscore-framework>
      </ios>
       
      <modules>
      	<module platform="iphone" version="1.2.5">hyperloop</module>
      </modules>
       
      <plugins>
      	<plugin>hyperloop</plugin>
      </plugins>
      

      4. create a `src` folder and put TesseractOCR.framework in
      5. add Lenore3.png to Resources/iPhone
      6. add tessdata folder to Resources/iPhone
      7. create a `appc.js` file, and use this as content

      /**
       * Hyperloop configuration
       */
       
       
      module.exports = {
      	type: 'app',
      	group: 'titanium',
      	dependencies: {
      	},
      	hyperloop: {
      		ios: {
      			xcodebuild: {
      				/**
      				 * any flags available to be passed into the Xcode can be
      				 * included here to further customize the xcode build
      				 */
      				flags: {
      //					GCC_PREPROCESSOR_DEFINITIONS: 'foo=bar'
      					FRAMEWORK_SEARCH_PATHS: '../../src'
      				},
      				/**
      				 * this sample doesn't use StoreKit but this demonstrates
      				 * how you can bring in frameworks explicitly. Hyperloop
      				 * will automatically determine the required frameworks
      				 * but in case you want to force a specific version, you can
      				 * include it here
      				 */
      				frameworks: [
      					'TesseractOCR'
      				]
      			},
      			/**
      			 * 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: {
      				'TesseractOCR': {
      					// these can be an array or string
      					source: ['src'],
      					header: 'src',
      					resource: 'src'
      				}
      			}
      		}
      	}
      };
      

      6. in Resources/app.js, use this

      var G8Tesseract = require('TesseractOCR/G8Tesseract');
      var UIImage = require('UIKit/UIImage');
       
      var win = Ti.UI.createWindow({
      	backgroundColor: 'white',
      	layout: 'vertical'
      });
       
      var imageView = Ti.UI.createImageView({
      	image: 'Lenore3.png'
      });
       
      win.add(imageView);
       
      var btn = Ti.UI.createButton({
      	title: 'OCR THIS'
      });
       
      win.add(btn);
       
      var textArea = Ti.UI.createTextArea({
      	borderWidth: 2,
      	borderColor: 'blue',
      	width: Ti.UI.FILL,
      	height: Ti.UI.FILL
      });
      win.add(textArea);
       
      btn.addEventListener('click', function(e) {
      	var tess = G8Tesseract.alloc().initWithLanguage('eng+ita');
      	var img = UIImage.imageNamed('Lenore3.png');	
      	tess.setImage(img);
      	tess.recognize();
      	textArea.setValue(tess.recognizedText.toString());
      });
       
      win.open();
      

      Expected Result

      app builds flawlessly

      Actual Result

      [TRACE] :  /Users/kiat/titaniumTestWatch/HLTesseract/build/iphone/Classes/TiToJS.h:125:9: fatal error: 'JavaScriptCore/TiCore.h' file not found
      [TRACE] :  #import "JavaScriptCore/TiCore.h"
      [TRACE] :          ^
      [TRACE] :  1 error generated.
      [ERROR] ** BUILD FAILED **
      [ERROR] The following build commands failed:
      [ERROR]         CompileC build/Intermediates/HLTesseract.build/Debug-iphonesimulator/HLTesseract.build/Objects-normal/x86_64/TiFile.o Classes/TiFile.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emerriman Eric Merriman
                Reporter:
                cng Chee Kiat Ng (Inactive)
                Reviewer:
                Hans Knöchel
                Tester:
                Josh Longton
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-9983
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code