Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when using in non-swift project #6

Open
robbash opened this issue Jan 27, 2019 · 1 comment
Open

Issue when using in non-swift project #6

robbash opened this issue Jan 27, 2019 · 1 comment

Comments

@robbash
Copy link

robbash commented Jan 27, 2019

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
Copy link

nanunh commented Mar 22, 2019

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:
- flutter_photokit does not specify a Swift version and none of the targets (Runner) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod. /usr/local/Cellar/cocoapods/1.6.0/libexec/gems/cocoapods-1.6.0/lib/cocoapods/installer/xcode/target_validator.rb:115:in `verify_swift_pods_swift_version'

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants