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

Hyperloop: iOS - Cannot use PHPhotoLibrary API due to cast errors

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Release 8.0.0
    • Fix Version/s: None
    • Component/s: Hyperloop
    • Labels:

      Description

      I want to access the photos saved on the device in titanium. If I create a new project and add

      var photos = require('PhotoKit/PHPhotoLibrary');

      I get the following build log.

       
      [INFO] :   Alloy compiled in 0.46666s
      [INFO] :   Alloy compiler completed successfully
      [INFO] :   JavaScript files need to be encrypted
      [INFO] :   Creating Xcode project
      [INFO] :   Creating Entitlements.plist
      [INFO] :   Creating Info.plist
      [INFO] :   Disabling ATS
      [INFO] :   Creating main.m
      [INFO] :   Creating Xcode config files
      [INFO] :   Copying Titanium libraries
      [INFO] :   Copying Titanium iOS files
      [INFO] :   Installing default LaunchScreen.storyboard
      [INFO] :   Creating debugger and profiler plists
      [INFO] :   Analyzing Resources directory
      [INFO] :   Analyzing platform files
      [INFO] :   Analyzing module files
      [INFO] :   Analyzing localized launch images
      [INFO] :   Analyzing CommonJS modules
      [INFO] :   Creating asset catalog
      [INFO] :   Creating app icon set
      [INFO] :   Creating launch logo image set
      [INFO] :   Creating launch image set
      [INFO] :   Creating assets image set
      [INFO] :   Processing JavaScript files
      [INFO] :   Writing app properties
      [INFO] :   Encrypting JavaScript files
      [INFO] :   Writing i18n files
      [INFO] :   Processing Titanium symbols
      [INFO] :   Removing files
      [INFO] :   Optimizing .plist and .png files
      [INFO] :   Starting Hyperloop assembly
      [INFO] :   Skipping Hyperloop compile, no usage found ...
      [INFO] :   Finished Hyperloop assembly in 0 seconds
      [INFO] :   Invoking xcodebuild
      [INFO] :   Finished building the application in 13s 265ms
      [INFO] :   Installing app on device: Ideagen PLC iPad
      [INFO] :   App successfully installed on device: Ideagen PLC iPad
      Please manually launch the application
      [INFO] :   hyperloop-photo-album/1.0 (7.2.0.ecae6740fe)
      [ERROR] :  Script Error Couldn't find module: PhotoKit/PHPhotoLibrary for architecture: armv7
      

      It appears to skip hyperloop assembly. If I build the app again after adding

      var view = require('UIKit/UIView');

      I get the following log.

      [INFO] :   Alloy compiled in 0.47754s
      [INFO] :   Alloy compiler completed successfully
      [INFO] :   JavaScript files need to be encrypted
      [INFO] :   Creating Xcode project
      [INFO] :   Creating Entitlements.plist
      [INFO] :   Creating Info.plist
      [INFO] :   Disabling ATS
      [INFO] :   Creating main.m
      [INFO] :   Creating Xcode config files
      [INFO] :   Copying Titanium libraries
      [INFO] :   Copying Titanium iOS files
      [INFO] :   Installing default LaunchScreen.storyboard
      [INFO] :   Creating debugger and profiler plists
      [INFO] :   Analyzing Resources directory
      [INFO] :   Analyzing platform files
      [INFO] :   Analyzing module files
      [INFO] :   Analyzing localized launch images
      [INFO] :   Analyzing CommonJS modules
      [INFO] :   Creating asset catalog
      [INFO] :   Creating app icon set
      [INFO] :   Creating launch logo image set
      [INFO] :   Creating launch image set
      [INFO] :   Creating assets image set
      [INFO] :   Processing JavaScript files
      [INFO] :   Writing app properties
      [INFO] :   Encrypting JavaScript files
      [INFO] :   Writing i18n files
      [INFO] :   Processing Titanium symbols
      [INFO] :   Removing files
      [INFO] :   Optimizing .plist and .png files
      [INFO] :   Starting Hyperloop assembly
      [WARN] :   [Hyperloop] couldn't find class Protocol * {"name":"protocol","optional":false,"type":{"type":"objc_pointer","value":"Protocol *"}}
      [WARN] :   [Hyperloop] Not sure how to handle: name= nodeInteraction type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= eventValues type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= options type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= uc_stack type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= name type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= dylib type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= name type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= fl type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= timeout type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= name type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= name type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= fvmlib type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= gr_group type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= gsr_group type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= gsr_source type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= __u6_addr type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= ipi6_addr type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= ipi_spec_dst type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= ipi_addr type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= ip6m_addr type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= imr_multiaddr type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= imr_interface type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= imr_multiaddr type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= imr_sourceaddr type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= imr_interface type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= imr_multiaddr type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= imr_address type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= ip_dst type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= ipv6mr_multiaddr type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= it_interval type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= it_value type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= fsec_acl type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= msfr_group type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= name type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= linked_modules type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= path type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= ru_utime type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= ru_stime type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= _bf type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= _ub type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= _lb type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= __sigaction_u type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= sigev_value type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= si_value type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= sin_addr type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= sin6_addr type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= __darwin_rune_t type= function_proto value= function_proto
      [WARN] :   [Hyperloop] Not sure how to handle: name= client type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= umbrella type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= sub_library type= unknown type: 119 value= unknown type: 119
      [WARN] :   [Hyperloop] Not sure how to handle: name= sub_umbrella type= unknown type: 119 value= unknown type: 119
      [INFO] :   [Hyperloop] Generating class iAd/ADBannerView
      ...
      [INFO] :   [Hyperloop] Generating class PDFKit/PDFView
      [INFO] :   [Hyperloop] Generating class Photos/PHAdjustmentData
      [INFO] :   [Hyperloop] Generating class Photos/PHAsset
      [INFO] :   [Hyperloop] Generating class Photos/PHAssetChangeRequest
      [INFO] :   [Hyperloop] Generating class Photos/PHAssetCollectionChangeRequest
      [INFO] :   [Hyperloop] Generating class Photos/PHAssetResource
      [INFO] :   [Hyperloop] Generating class Photos/PHCollection
      [INFO] :   [Hyperloop] Generating class Photos/PHCollectionListChangeRequest
      [INFO] :   [Hyperloop] Generating class Photos/PHContentEditingInput
      [INFO] :   [Hyperloop] Generating class Photos/PHImageManager
      [INFO] :   [Hyperloop] Generating class Photos/PHImageRequestOptions
      [INFO] :   [Hyperloop] Generating class Photos/PHLivePhoto
      [INFO] :   [Hyperloop] Generating class Photos/PHLivePhotoRequestOptions
      [INFO] :   [Hyperloop] Generating class PhotosUI/PHLivePhotoView
      [INFO] :   [Hyperloop] Generating class Photos/PHObject
      [INFO] :   [Hyperloop] Generating class Photos/PHVideoRequestOptions
      [INFO] :   [Hyperloop] Generating class PassKit/PKAddPassesViewController
      ...
      [INFO] :   [Hyperloop] Generating custom Hyperloop/Custom
      [INFO] :   Generation took 3791 ms
      [INFO] :   Forcing rebuild: Xcode project has changed since last build
      [INFO] :   Finished Hyperloop assembly in 20.83 seconds
      [INFO] :   Invoking xcodebuild
      [INFO] :   Finished building the application in 37s 603ms
      [INFO] :   Installing app on device: Ideagen PLC iPad
      [INFO] :   App successfully installed on device: Ideagen PLC iPad
      Please manually launch the application
      [INFO] :   hyperloop-photo-album/1.0 (7.2.0.ecae6740fe)
      [ERROR] :  Script Error Couldn't find module: PhotoKit/PHPhotoLibrary for architecture: armv7
      

      This time it has compiled hyperloop but in the list of generated hyperloop classes logged PhotoKit/PHPhotoLibrary doesn't appear, but Photos/PHPhotoLibrary does so if I try again with

      var photos = require('PhotoKit/PHPhotoLibrary');

      I get the following build log.

      [INFO] :   Alloy compiled in 0.40499s
      [INFO] :   Alloy compiler completed successfully
      [INFO] :   JavaScript files need to be encrypted
      [INFO] :   Creating Xcode project
      [INFO] :   Creating Entitlements.plist
      [INFO] :   Creating Info.plist
      [INFO] :   Disabling ATS
      [INFO] :   Creating main.m
      [INFO] :   Creating Xcode config files
      [INFO] :   Copying Titanium libraries
      [INFO] :   Copying Titanium iOS files
      [INFO] :   Installing default LaunchScreen.storyboard
      [INFO] :   Creating debugger and profiler plists
      [INFO] :   Analyzing Resources directory
      [INFO] :   Analyzing platform files
      [INFO] :   Analyzing module files
      [INFO] :   Analyzing localized launch images
      [INFO] :   Analyzing CommonJS modules
      [INFO] :   Creating asset catalog
      [INFO] :   Creating app icon set
      [INFO] :   Creating launch logo image set
      [INFO] :   Creating launch image set
      [INFO] :   Creating assets image set
      [INFO] :   Processing JavaScript files
      [INFO] :   Writing app properties
      [INFO] :   Encrypting JavaScript files
      [INFO] :   Writing i18n files
      [INFO] :   Processing Titanium symbols
      [INFO] :   Removing files
      [INFO] :   Optimizing .plist and .png files
      [INFO] :   Starting Hyperloop assembly
      [INFO] :   Forcing rebuild: Xcode project has changed since last build
      [INFO] :   Finished Hyperloop assembly in 12.12 seconds
      [INFO] :   Invoking xcodebuild
      [ERROR] :  ** BUILD FAILED **
      [ERROR] :  The following build commands failed:
      [ERROR] :  	CompileC build/Intermediates/hyperloop-photo-album.build/Debug-iphoneos/hyperloop-photo-album.build/Objects-normal/armv7/photos.o /Users/donaldanderson/Documents/Appcelerator_Studio_Workspace/hyperloop-photo-album/build/hyperloop/ios/js/photos/photos.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
      [ERROR] :  (1 failure)
      

      This time I get the compile error I described in AC-5813. The issue was closed as invalid with the advice to use PhotoKit/PHPhotoLibrary instead of Photos/PHPhotoLibrary. Neither seem to work for me and I'm not sure if it's a bug or if I'm doing something wrong. I haven't posted full logs as this description seems to have a 32,767 character limit.

        Attachments

          Activity

            People

            • Assignee:
              jvennemann Jan Vennemann
              Reporter:
              donald.anderson Donald Anderson
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code