esysberlin / esys-flutter-share

A Flutter plugin for sharing files & text with other applications.
Apache License 2.0
130 stars 147 forks source link

`esys_flutter_share` does not specify a Swift version #24

Closed Livinglist closed 5 years ago

Livinglist commented 5 years ago

I am using esys_flutter_share 1.0.1 and when I was building for iOS, the error was thrown. Console shows


Running pod install...
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Finding Podfile changes
      A esys_flutter_share
      R share
      - Firebase
      - Flutter
      - cloud_firestore
      - connectivity
      - firebase_admob
      - firebase_core
      - google_sign_in
      - package_info
      - path_provider
      - qrcode_reader
      - shared_preferences
      - sqflite
      - url_launcher

    Fetching external sources
    -> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
    -> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
    -> Fetching podspec for `connectivity` from `.symlinks/plugins/connectivity/ios`
    -> Fetching podspec for `esys_flutter_share` from `.symlinks/plugins/esys_flutter_share/ios`
    -> Fetching podspec for `firebase_admob` from `.symlinks/plugins/firebase_admob/ios`
    -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
    -> Fetching podspec for `google_sign_in` from `.symlinks/plugins/google_sign_in/ios`
    -> Fetching podspec for `package_info` from `.symlinks/plugins/package_info/ios`
    -> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
    -> Fetching podspec for `qrcode_reader` from `.symlinks/plugins/qrcode_reader/ios`
    -> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
    -> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`
    -> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`

    Resolving dependencies of `Podfile`

    Comparing resolved specification to the sandbox manifest
      A BoringSSL-GRPC
      A FMDB
      A Firebase
      A FirebaseAnalytics
      A FirebaseAuth
      A FirebaseAuthInterop
      A FirebaseCore
      A FirebaseDatabase
      A FirebaseFirestore
      A FirebaseInstanceID
      A Flutter
      A GTMSessionFetcher
      A Google-Mobile-Ads-SDK
      A GoogleAppMeasurement
      A GoogleSignIn
      A GoogleToolboxForMac
      A GoogleUtilities
      A Protobuf
      A Reachability
      A cloud_firestore
      A connectivity
      A esys_flutter_share
      A firebase_admob
      A firebase_core
      A gRPC-C++
      A gRPC-Core
      A google_sign_in
      A leveldb-library
      A nanopb
      A package_info
      A path_provider
      A qrcode_reader
      A shared_preferences
      A sqflite
      A url_launcher

    Downloading dependencies

    -> Installing BoringSSL-GRPC (0.0.2)
      > Copying BoringSSL-GRPC from `/Users/george/Library/Caches/CocoaPods/Pods/Release/BoringSSL-GRPC/0.0.2-2a230` to `Pods/BoringSSL-GRPC`

    -> Installing FMDB (2.7.5)
      > Copying FMDB from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FMDB/2.7.5-2ce00` to `Pods/FMDB`

    -> Installing Firebase (5.17.0)
      > Copying Firebase from `/Users/george/Library/Caches/CocoaPods/Pods/Release/Firebase/5.17.0-59d55` to `Pods/Firebase`

    -> Installing FirebaseAnalytics (5.6.0)
      > Copying FirebaseAnalytics from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseAnalytics/5.6.0-75e4b` to `Pods/FirebaseAnalytics`

    -> Installing FirebaseAuth (5.3.1)
      > Copying FirebaseAuth from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseAuth/5.3.1-0f61e` to `Pods/FirebaseAuth`

    -> Installing FirebaseAuthInterop (1.0.0)
      > Copying FirebaseAuthInterop from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseAuthInterop/1.0.0-0ffa5` to `Pods/FirebaseAuthInterop`

    -> Installing FirebaseCore (5.3.0)
      > Copying FirebaseCore from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseCore/5.3.0-c0c4b` to `Pods/FirebaseCore`

    -> Installing FirebaseDatabase (5.1.0)
      > Copying FirebaseDatabase from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseDatabase/5.1.0-23acb` to `Pods/FirebaseDatabase`

    -> Installing FirebaseFirestore (1.0.1)
      > Copying FirebaseFirestore from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseFirestore/1.0.1-e95af` to `Pods/FirebaseFirestore`

    -> Installing FirebaseInstanceID (3.5.0)
      > Copying FirebaseInstanceID from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseInstanceID/3.5.0-4522a` to `Pods/FirebaseInstanceID`

    -> Installing Flutter (1.0.0)

    -> Installing GTMSessionFetcher (1.2.1)
      > Copying GTMSessionFetcher from `/Users/george/Library/Caches/CocoaPods/Pods/Release/GTMSessionFetcher/1.2.1-32aec` to `Pods/GTMSessionFetcher`

    -> Installing Google-Mobile-Ads-SDK (7.40.0)
      > Copying Google-Mobile-Ads-SDK from `/Users/george/Library/Caches/CocoaPods/Pods/Release/Google-Mobile-Ads-SDK/7.40.0-9d1c3` to `Pods/Google-Mobile-Ads-SDK`

    -> Installing GoogleAppMeasurement (5.6.0)
      > Copying GoogleAppMeasurement from `/Users/george/Library/Caches/CocoaPods/Pods/Release/GoogleAppMeasurement/5.6.0-008e0` to `Pods/GoogleAppMeasurement`

    -> Installing GoogleSignIn (4.4.0)
      > Copying GoogleSignIn from `/Users/george/Library/Caches/CocoaPods/Pods/Release/GoogleSignIn/4.4.0-7ff24` to `Pods/GoogleSignIn`

    -> Installing GoogleToolboxForMac (2.2.0)
      > Copying GoogleToolboxForMac from `/Users/george/Library/Caches/CocoaPods/Pods/Release/GoogleToolboxForMac/2.2.0-ff316` to `Pods/GoogleToolboxForMac`

    -> Installing GoogleUtilities (5.3.7)
      > Copying GoogleUtilities from `/Users/george/Library/Caches/CocoaPods/Pods/Release/GoogleUtilities/5.3.7-111a0` to `Pods/GoogleUtilities`

    -> Installing Protobuf (3.6.1)
      > Copying Protobuf from `/Users/george/Library/Caches/CocoaPods/Pods/Release/Protobuf/3.6.1-1eb97` to `Pods/Protobuf`

    -> Installing Reachability (3.2)
      > Copying Reachability from `/Users/george/Library/Caches/CocoaPods/Pods/Release/Reachability/3.2-33e18` to `Pods/Reachability`

    -> Installing cloud_firestore (0.0.1)

    -> Installing connectivity (0.0.1)

    -> Installing esys_flutter_share (0.0.1)

    -> Installing firebase_admob (0.0.1)

    -> Installing firebase_core (0.0.1)

    -> Installing gRPC-C++ (0.0.6)
      > Copying gRPC-C++ from `/Users/george/Library/Caches/CocoaPods/Pods/Release/gRPC-C++/0.0.6-e7644` to `Pods/gRPC-C++`

    -> Installing gRPC-Core (1.17.0)
      > Copying gRPC-Core from `/Users/george/Library/Caches/CocoaPods/Pods/Release/gRPC-Core/1.17.0-40280` to `Pods/gRPC-Core`

    -> Installing google_sign_in (0.0.1)

    -> Installing leveldb-library (1.20)
      > Copying leveldb-library from `/Users/george/Library/Caches/CocoaPods/Pods/Release/leveldb-library/1.20-08cba` to `Pods/leveldb-library`

    -> Installing nanopb (0.3.901)
      > Copying nanopb from `/Users/george/Library/Caches/CocoaPods/Pods/Release/nanopb/0.3.901-2901f` to `Pods/nanopb`

    -> Installing package_info (0.0.1)

    -> Installing path_provider (0.0.1)

    -> Installing qrcode_reader (0.0.1)

    -> Installing shared_preferences (0.0.1)

    -> Installing sqflite (0.0.1)

    -> Installing url_launcher (0.0.1)
      - Running pre install hooks
    [!] Unable to determine Swift version for the following pods:

    - `esys_flutter_share` 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.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/xcode/target_validator.rb:115:in `verify_swift_pods_swift_version'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/xcode/target_validator.rb:37:in `validate!'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:459:in `validate_targets'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:138:in `install!'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/command/install.rb:48:in `run'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/command.rb:52:in `run'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/bin/pod:55:in `<top (required)>'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/bin/pod:22:in `load'
    /usr/local/Cellar/cocoapods/1.6.1/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ʀ.```
yash365 commented 5 years ago

Getting the same error :

 `esys_flutter_share` 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.  Error output from CocoaPods:
ltvu93 commented 5 years ago

Same here.

 Unable to determine Swift version for the following pods:

    - `esys_flutter_share` 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.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/xcode/target_validator.rb:115:in `verify_swift_pods_swift_version'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/xcode/target_validator.rb:37:in `validate!'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:459:in `validate_targets'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:138:in `install!'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/command/install.rb:48:in `run'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/command.rb:52:in `run'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/bin/pod:55:in `<top (required)>'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/bin/pod:22:in `load'
    /usr/local/Cellar/cocoapods/1.6.1/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 8.

Solution: Follow this link to add swift to your project and add this block in your Podfile.

target 'Runner' do
  use_frameworks!  # required by simple_permission
  ...
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.0'  # required by simple_permission
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end
d-wolf commented 5 years ago

duplicate https://github.com/esysberlin/esys-flutter-share/issues/15

idurvesh commented 5 years ago

I did edit the file, still, it gives me the same error.

rashimahajan commented 5 years ago

@idurvesh Please follow below steps :

In this case bridging header must be created. 1.Open the project with XCode. Then choose File -> New -> File -> Swift File. A dialog will be displayed when creating the swift file(Since this file is deleted, any name can be used.). XCode will ask you if you wish to create Bridging Header, click yes. 2.Make sure you have use_frameworks! in the Runner block, in ios/Podfile。

  1. Make sure you have SWIFT_VERSION 4.2 selected in you XCode -> Build Settings 4.Do flutter clean
  2. Go to your ios folder, delete Podfile.lock and Pods folder and then execute pod install --repo-update
ferso commented 5 years ago

@idurvesh Please follow below steps :

In this case bridging header must be created. 1.Open the project with XCode. Then choose File -> New -> File -> Swift File. A dialog will be displayed when creating the swift file(Since this file is deleted, any name can be used.). XCode will ask you if you wish to create Bridging Header, click yes. 2.Make sure you have use_frameworks! in the Runner block, in ios/Podfile。

  1. Make sure you have SWIFT_VERSION 4.2 selected in you XCode -> Build Settings 4.Do flutter clean
  2. Go to your ios folder, delete Podfile.lock and Pods folder and then execute pod install --repo-update

What is the name of Swift file that i need to created and where i need to located it, can you help me pls ?

rashimahajan commented 5 years ago

After following these steps,Xcode will automatically generate the bridge header file in the workspace.

qingyc commented 5 years ago

@idurvesh Please follow below steps :

In this case bridging header must be created. 1.Open the project with XCode. Then choose File -> New -> File -> Swift File. A dialog will be displayed when creating the swift file(Since this file is deleted, any name can be used.). XCode will ask you if you wish to create Bridging Header, click yes. 2.Make sure you have use_frameworks! in the Runner block, in ios/Podfile。

  1. Make sure you have SWIFT_VERSION 4.2 selected in you XCode -> Build Settings 4.Do flutter clean
  2. Go to your ios folder, delete Podfile.lock and Pods folder and then execute pod install --repo-update

it works for me

TheFedex87 commented 4 years ago

@idurvesh Please follow below steps :

In this case bridging header must be created. 1.Open the project with XCode. Then choose File -> New -> File -> Swift File. A dialog will be displayed when creating the swift file(Since this file is deleted, any name can be used.). XCode will ask you if you wish to create Bridging Header, click yes. 2.Make sure you have use_frameworks! in the Runner block, in ios/Podfile。

  1. Make sure you have SWIFT_VERSION 4.2 selected in you XCode -> Build Settings 4.Do flutter clean
  2. Go to your ios folder, delete Podfile.lock and Pods folder and then execute pod install --repo-update

this works!!! thank you very much

sgursoy commented 4 years ago

@idurvesh Please follow below steps :

In this case bridging header must be created. 1.Open the project with XCode. Then choose File -> New -> File -> Swift File. A dialog will be displayed when creating the swift file(Since this file is deleted, any name can be used.). XCode will ask you if you wish to create Bridging Header, click yes. 2.Make sure you have use_frameworks! in the Runner block, in ios/Podfile。

  1. Make sure you have SWIFT_VERSION 4.2 selected in you XCode -> Build Settings 4.Do flutter clean
  2. Go to your ios folder, delete Podfile.lock and Pods folder and then execute pod install --repo-update

thank you..

SardorbekR commented 3 years ago

Solution: https://stackoverflow.com/a/58784154/10969195

insidert commented 3 years ago

Solution: https://stackoverflow.com/a/58784154/10969195

ENV['SWIFT_VERSION'] = '5' at the top of the podfile fixed the issue.