Closed ghost closed 6 years ago
@germanmarcus suggested workaround (set SWIFT_SWIFT3_OBJC_INFERENCE
and SWIFT_VERSION
) do not work for me, reported error:
Launching lib/main.dart on iPhone X in debug mode...
Running pod install... 0.6s
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
[!] There may only be up to 1 unique SWIFT_VERSION per target. Found target(s) with multiple Swift versions:
Runner: Swift
Runner: Swift 4.0
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer/target_inspector.rb:248:in `compute_swift_version_from_targets'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer/target_inspector.rb:50:in `compute_results'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:921:in `block (3 levels) in inspect_targets_to_integrate'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:919:in `each'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:919:in `block (2 levels) in inspect_targets_to_integrate'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:917:in `each'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:917:in `block in inspect_targets_to_integrate'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:912:in `inspect_targets_to_integrate'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:78:in `analyze'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:243:in `analyze'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:116:in `install!'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
/usr/local/Cellar/cocoapods/1.5.3/libexec/bin/pod:22:in `load'
/usr/local/Cellar/cocoapods/1.5.3/libexec/bin/pod:22:in `<main>'
Error output from CocoaPods:
↳
[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error running pod install
Error launching application on iPhone X.
do you find a solution?
Could you update to 0.0.7 and tell me if you still have the issue ?
using 0.0.7 i get this from the import in ContactsServicePlugin.m:
fatal error: 'contacts_service/contacts_service-Swift.h' file not found
i'm completely unfamiliar with swift though, so i tried to somehow import SwiftContactsServicePlugin.swift instead. to no avail. i'm not sure if that file is missing, or should just be renamed.
@blaneyneil seems a "non issue", do you bootstrap the flutter project using swift? Since this plugin use swift you need to use -i flutter
flag when do you create a project.
No solution to add swift support on already running project, the suggested solution is to:
ios
folderios
folder with the ios
folder created from new project that include swift supportI tested it and work like a charm (see other issue), eg (supposing your project is awesome_project
):
$ ls .
awesome_project
$ mkdir test
$ cd test
$ flutter create -i swift awesome_project
$ cd ..
$ mv awesome_project/ios awesome_project/ios_bak
$ mv test/awesome_project/ios awesome_project/ios
$ rm -rf test
$ cd awesome_project
$ flutter packages get
than edit the ios/Runner/Info.plist
to include permission and rebuild your flutter project.
Do what Mavimo suggested or you can simply remove ios folder and run this command
$ flutter create -i swift .
This will rebuild the project with swift integration
Hi,
the example works fine. But when I tried to compile my own project, the following error occurred:
I figured out, that the solution/ workaround is to change the configuration in "ios/Runner.xcodeproj/project.pbxproj": from
VERSIONING_SYSTEM = "apple-generic";
toIs there a dependency compiled in an earlier swift version that could be updated?
Best, Marcus