jibon57 / nativescript-mediafilepicker

A complete file picker solution for NativeScript
Apache License 2.0
51 stars 36 forks source link

Build failed for ios when adding the plugin xcode 11.5 #117

Closed OPADA-Eng closed 3 years ago

OPADA-Eng commented 4 years ago

Describe the bug There is a problem when building for ios and it's showing error regarding rename functions in DKImagePickerController To Reproduce Steps to reproduce the behavior: tns run plugin add tns run ios

Expected behavior Build failed

NativeScript Info(please run tns info): "tns-core-modules": "~6.5.0", "tns-ios": { "version": "6.5.1" }

Sample Code(please provide minimum code to reproduce problem): Error Msg:

Users/opada-eng/Documents/Projects.nosync/NativeScript/my-app/platforms/ios/Pods/DKPhotoGallery/DKPhotoGallery/Preview/ImagePreview/DKPhotoImageDownloader.swift:35:22: error: use of unresolved identifier 'SDWebImageDownloaderConfig'
        let config = SDWebImageDownloaderConfig()
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/opada-eng/Documents/Projects.nosync/NativeScript/my-app/platforms/ios/Pods/DKPhotoGallery/DKPhotoGallery/Preview/ImagePreview/DKPhotoImagePreviewVC.swift:129:38: error: method 'shared' was used as a property; add () to call it
            var image = SDImageCache.shared.imageFromMemoryCache(forKey: key)
                                     ^
                                           ()
/Users/opada-eng/Documents/Projects.nosync/NativeScript/my-app/platforms/ios/Pods/DKPhotoGallery/DKPhotoGallery/Preview/ImagePreview/DKPhotoImagePreviewVC.swift:134:38: error: method 'shared' was used as a property; add () to call it
                        SDImageCache.shared.store(nil, imageData: data, forKey: key, toDisk: false, completion: nil)
                                     ^
                                           ()
/Users/opada-eng/Documents/Projects.nosync/NativeScript/my-app/platforms/ios/Pods/DKPhotoGallery/DKPhotoGallery/Preview/ImagePreview/DKPhotoImagePreviewVC.swift:172:22: error: method 'shared' was used as a property; add () to call it
        SDImageCache.shared.queryCacheOperation(forKey: key, options: SDImageCacheOptions.scaleDownLargeImages.union(.queryMemoryData)) { (image, data, cacheType) in
                     ^
                           ()
/Users/opada-eng/Documents/Projects.nosync/NativeScript/my-app/platforms/ios/Pods/DKPhotoGallery/DKPhotoGallery/Preview/ImagePreview/DKPhotoImagePreviewVC.swift:172:119: error: type 'SDImageCacheOptions' has no member 'queryMemoryData'
        SDImageCache.shared.queryCacheOperation(forKey: key, options: SDImageCacheOptions.scaleDownLargeImages.union(.queryMemoryData)) { (image, data, cacheType) in
                                                                                                                     ~^~~~~~~~~~~~~~~
/Users/opada-eng/Documents/Projects.nosync/NativeScript/my-app/platforms/ios/Pods/DKPhotoGallery/DKPhotoGallery/Preview/ImagePreview/DKPhotoImagePreviewVC.swift:239:30: error: method 'shared' was used as a property; add () to call it
                SDImageCache.shared.queryCacheOperation(forKey: originalURL.absoluteString,
                             ^
                                   ()
/Users/opada-eng/Documents/Projects.nosync/NativeScript/my-app/platforms/ios/Pods/DKPhotoGallery/DKPhotoGallery/Preview/ImagePreview/DKPhotoImagePreviewVC.swift:267:30: error: method 'shared' was used as a property; add () to call it
                SDImageCache.shared.queryCacheOperation(forKey: originalURL.absoluteString) { [weak self] (image, data, _) in

Additional context This happened before adding any code regarding the plugin.

jibon57 commented 4 years ago

You can try to follow this one: https://github.com/jibon57/nativescript-mediafilepicker/issues/106#issuecomment-608887271

OPADA-Eng commented 4 years ago

I have tried that and didn't get any success result.

OPADA-Eng commented 4 years ago

any solution?

pap5508 commented 4 years ago

I think that you can check your pod version for SDWebImage. Because with this plugin uses 5.9.0. Please check SDWebImage used in different plugin podfile used in your application and update it to 5.9.0. this issue will be resolved.

Manoj-1996 commented 4 years ago

Hi, i am also having same issue. @pap5508 - i update the the SDWebImage to 5.9.0 and its not working.

pap5508 commented 4 years ago

Hi, i am also having same issue. @pap5508 - i update the the SDWebImage to 5.9.0 and its not working.

Please search version of SDwebImage in node_modules as well. There is some plugin that uses SDwebImage 4.4.1. For example nativescript-web-image-cache use 4.4.1

You can change that version to 5.9.0 and run npm install. Try again with running application.

If doesnt work please share me your package.json so that I can look further into your problem.

Manoj-1996 commented 4 years ago

{ "nativescript": { "id": "org.nativescript.project1", "tns-ios": { "version": "6.5.0" }, "tns-android": { "version": "6.5.3" } }, "description": "NativeScript Application", "license": "SEE LICENSE IN ", "repository": "", "dependencies": { "@angular/animations": "~8.2.0", "@angular/common": "~8.2.0", "@angular/compiler": "~8.2.0", "@angular/core": "~8.2.0", "@angular/forms": "~8.2.0", "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", "@nativescript/theme": "~2.3.0", "@nstudio/nativescript-checkbox": "^1.0.0", "@nstudio/nativescript-pulltorefresh": "^2.0.0", "nativescript-angular": "~8.21.0", "nativescript-background-http": "^4.2.1", "nativescript-clipboard": "^2.0.0", "nativescript-image": "^3.0.12", "nativescript-image-caching": "^1.0.2", "nativescript-mediafilepicker": "^1.0.7", "nativescript-ng-ripple": "^2.0.1", "nativescript-pager": "^12.0.0-alpha.8", "nativescript-plugin-firebase": "^10.5.2", "nativescript-toast": "^2.0.0", "nativescript-ui-listview": "^8.2.0", "nativescript-urlhandler": "^1.3.0", "reflect-metadata": "~0.1.12", "rxjs": "^6.4.0", "time-ago-pipe": "^1.3.2", "tns-core-modules": "~6.5.0", "zone.js": "~0.9.1" }, "devDependencies": { "@angular/cli": "^10.0.3", "@angular/compiler-cli": "~8.2.0", "@nativescript/schematics": "^9.0.0", "@ngtools/webpack": "~8.2.0", "@schematics/angular": "^10.0.4", "nativescript-dev-webpack": "~1.5.0", "tns-android": "6.5.3", "tns-ios": "6.5.0", "tns-platform-declarations": "^6.5.15", "tslint": "^6.1.2", "typescript": "~3.5.3" }, "gitHead": "20a65d338ae8f8911087ab6615b89363f864b07b", "readme": "NativeScript Application" }

this is the package.jons used should i change any other version.

OPADA-Eng commented 3 years ago

I got it to work finally with the following steps:

change the pod file in the plugin nativescript-web-image-cache to pod 'SDWebImage', '~> 5.9.0'

add the below to app/App_Resources/iOS/Podfile :

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'DKImagePickerController'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '5.0'
      end
    end
  end
end

This should fix the error and build the project.