flore2003 / nativescript-markdown-view

A NativeScript plugin that provides a natively rendered markdown view
MIT License
18 stars 7 forks source link

PodFile SWIFT_SWIFT3_OBJC_INFERENCE to On #13

Open lostation opened 4 years ago

lostation commented 4 years ago

Hi,

I've recently installed your great markdown lib into my Nativescript angular app. Thanks for that ! But it seems your PodFile is changing the build configuration of Xcode.

post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_SWIFT3_OBJC_INFERENCE'] = 'On' end end end

pod 'TSMarkdownParser'

This was failing the iOS build process for other libs !

Example of error it created with nativescript-toasty :

error: method 'makeToastActivity' with Objective-C selector 'makeToastActivity:' conflicts with previous declaration with the same Objective-C selector @objc func makeToastActivity(_ point: CGPoint) { ^ .../platforms/ios/Pods/Toast-Swift/Toast/Toast.swift:279:9: note: 'makeToastActivity' previously declared here func makeToastActivity(_ position: ToastPosition) { ^ note: Using new build systemnote: Planning buildnote: Constructing build descriptionwarning: **The use of Swift 3 @objc inference in Swift 4 mode is deprecated**. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the **"Swift 3 @objc Inference" build setting to "Default"** for the "Toast-Swift" target. (in target 'Toast-Swift' from project 'Pods')warning: The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Toast-Swift" target. (in target 'Toast-Swift' from project 'Pods') ** BUILD FAILED **

---> So I needed to change this line to :

config.build_settings['SWIFT_SWIFT3_OBJC_INFERENCE'] = 'Default'

to get the build pass and working again.

Can you confirm that changing this will not make your lib not working as expected ?

If so, can you update your repo ?

Thanks for help and thank you for this plugin ! Lo.

eloiqs commented 3 years ago

I have the exact same issue. I cretead App_Ressources/ios/Podfile with this content

post_install do |installer|
  installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_SWIFT3_OBJC_INFERENCE'] = 'Default'
    end
  end
end

effectively overriding this plugin's mistake.

flore2003 commented 3 years ago

Can you confirm that the plugin is working without any issue when the SWIFT_SWIFT3_OBJC_INFERENCE setting is set to Default?

lostation commented 3 years ago

Yes ;-)

flore2003 commented 2 years ago

Is this still an issue? Can someone create a PR for this?