kmorkos / flutter_photokit

Flutter plugin to interact with iOS PhotoKit
Other
8 stars 15 forks source link

Issue when using in non-swift project #6

Open robbash opened 5 years ago

robbash commented 5 years ago

Hey @kmorkos.

Thanks for this great plugin!

I open this issue as I ran into problems after adding it to my project. As it turned out the problem occurred because my project wasn't create with Swift support.

After some time searching I found the issue #16049 on the flutter repository, and by fiddling around with what is suggested, I could finally make my project build and run again, successfully using your plugin.

I think it could be worth mentioning in your docs that this problem exists, and how to resolve it.

Cheers!

nanunh commented 5 years ago

Here are a few documentation related topics that would help a first time user of this GREAT plugin...

Issue 1 - export LANG=en_US.UTF-8 issue If you see the error - CocoaPods requires your terminal to be using UTF-8 encoding.

Solution The fix is - If you have a .bash_profile add the following line to it export LANG=en_US.UTF-8 Or else If you have a .profile add the following line to it export LANG=en_US.UTF-8

Issue 2 - no platform was specified error issue If you see the following error - Error output from CocoaPods: ↳ [!] Automatically assigning platform ios with version 12.1 on target Runner because no platform was specified. Please specify a platform for this target in your Podfile.

Solution The solution is to Open YOURPROJECTNAME/ios/Podfile Edit/Add the line shown below - 12.1 should be the appropriate IOS “target” version # Uncomment this line to define a global platform for your project platform :ios, '12.1'

Issue 3 - does not specify a Swift version issue

If you have added the following four lines at appropriate locations in your Podfile

target 'Runner' do use_frameworks! config.build_settings['ENABLE_BITCODE'] = 'NO' config.build_settings['SWIFT_VERSION'] = '4.0'

And STILL encounter the following error

_Running pre install hooks [!] Unable to determine Swift version for the following pods:

Solution Then what worked for me was to add the following line to the Podfile

ENV['SWIFT_VERSION'] = '4.0'

DISCLAIMER - All the stuff above was collated from different links