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

iOS: Compile error if using Ti.Media APIs without openPhotoGallery

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 9.2.0
    • Fix Version/s: Release 9.2.1
    • Component/s: iOS
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      2020 Sprint 19

      Description

      Description

      Using Ti.Media APIs without using openPhotoGallery will cause a compile error

      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1837:17: error: expected a type
      [TRACE]  - (void)picker:(PHPickerViewController *)picker didFinishPicking:(NSArray<PHPickerResult *> *)results
      [TRACE]                  ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1837:75: error: unknown type name 'PHPickerResult'
      [TRACE]  - (void)picker:(PHPickerViewController *)picker didFinishPicking:(NSArray<PHPickerResult *> *)results
      [TRACE]                                                                            ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1792:7: error: use of undeclared identifier '_phPicker'
      [TRACE]    if (_phPicker != nil) {
      [TRACE]        ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1799:3: error: unknown type name 'PHPickerConfiguration'; did you mean 'UIPasteConfiguration'?
      [TRACE]    PHPickerConfiguration *configuration = [[PHPickerConfiguration alloc] init];
      [TRACE]    ^~~~~~~~~~~~~~~~~~~~~
      [TRACE]    UIPasteConfiguration
      [TRACE]  In module 'UIKit' imported from /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:33:
      [TRACE]  /Applications/Xcodebeta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPasteConfiguration.h:16:12: note: 'UIPasteConfiguration' declared here
      [TRACE]  @interface UIPasteConfiguration : NSObject <NSSecureCoding, NSCopying>
      [TRACE]             ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1799:44: error: unknown receiver 'PHPickerConfiguration'; did you mean 'UIPasteConfiguration'?
      [TRACE]    PHPickerConfiguration *configuration = [[PHPickerConfiguration alloc] init];
      [TRACE]                                             ^~~~~~~~~~~~~~~~~~~~~
      [TRACE]                                             UIPasteConfiguration
      [TRACE]  In module 'UIKit' imported from /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:33:
      [TRACE]  /Applications/Xcodebeta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPasteConfiguration.h:16:12: note: 'UIPasteConfiguration' declared here
      [TRACE]  @interface UIPasteConfiguration : NSObject <NSSecureCoding, NSCopying>
      [TRACE]             ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1806:19: error: property 'selectionLimit' not found on object of type 'UIPasteConfiguration *'
      [TRACE]      configuration.selectionLimit = [TiUtils intValue:[args objectForKey:@"selectionLimit"] def:allowMultiple ? 0 : 1];
      [TRACE]                    ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1812:33: error: use of undeclared identifier 'PHPickerFilter'
      [TRACE]            [filterList addObject:PHPickerFilter.imagesFilter];
      [TRACE]                                  ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1814:33: error: use of undeclared identifier 'PHPickerFilter'
      [TRACE]            [filterList addObject:PHPickerFilter.livePhotosFilter];
      [TRACE]                                  ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1816:33: error: use of undeclared identifier 'PHPickerFilter'
      [TRACE]            [filterList addObject:PHPickerFilter.videosFilter];
      [TRACE]                                  ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1823:27: error: use of undeclared identifier 'PHPickerFilter'
      [TRACE]      [filterList addObject:PHPickerFilter.imagesFilter];
      [TRACE]                            ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1826:3: error: use of undeclared identifier 'PHPickerFilter'
      [TRACE]    PHPickerFilter *filter = [PHPickerFilter anyFilterMatchingSubfilters:filterList];
      [TRACE]    ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1826:19: error: use of undeclared identifier 'filter'
      [TRACE]    PHPickerFilter *filter = [PHPickerFilter anyFilterMatchingSubfilters:filterList];
      [TRACE]                    ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1826:29: error: use of undeclared identifier 'PHPickerFilter'
      [TRACE]    PHPickerFilter *filter = [PHPickerFilter anyFilterMatchingSubfilters:filterList];
      [TRACE]                              ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1827:17: error: property 'filter' not found on object of type 'UIPasteConfiguration *'
      [TRACE]    configuration.filter = filter;
      [TRACE]                  ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1827:26: error: use of undeclared identifier 'filter'
      [TRACE]    configuration.filter = filter;
      [TRACE]                           ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1829:3: error: use of undeclared identifier '_phPicker'
      [TRACE]    _phPicker = [[PHPickerViewController alloc] initWithConfiguration:configuration];
      [TRACE]    ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1829:17: error: use of undeclared identifier 'PHPickerViewController'
      [TRACE]    _phPicker = [[PHPickerViewController alloc] initWithConfiguration:configuration];
      [TRACE]                  ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1831:4: error: use of undeclared identifier '_phPicker'
      [TRACE]    [_phPicker setDelegate:self];
      [TRACE]     ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1832:9: warning: instance method '-displayModalPicker:settings:' not found (return type defaults to 'id') [-Wobjc-method-access]
      [TRACE]    [self displayModalPicker:_phPicker settings:args];
      [TRACE]          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      [TRACE]  In file included from /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:11:
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.h:25:12: note: receiver is instance of class declared here
      [TRACE]  @interface MediaModule : TiModule <
      [TRACE]             ^
      [TRACE]  /Users/awam/Documents/Appcelerator_Studio_Workspace/ticreateapp/build/iphone/Classes/MediaModule.m:1832:28: error: use of undeclared identifier '_phPicker'
      [TRACE]    [self displayModalPicker:_phPicker settings:args];
      [TRACE]                             ^
      [TRACE]  fatal error: too many errors emitted, stopping now [-ferror-limit=]
      

      var window = Ti.UI.createWindow();
      Ti.Media.beep();
      window.open()
      

      Steps to reproduce

      1. Add the above code to an existing app.js
      2. Build for an iOS device appc run -p ios -T device --build-only

      Actual

      Compile error

      Expected

      No compile error

        Attachments

          Activity

            People

            • Assignee:
              eharris Ewan Harris
              Reporter:
              nicolomonili nicolomonili
              Reviewer:
              Christopher Williams
              Tester:
              Samir Mohammed
            • Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration