Flutter-geolocator: Swift ์–ธ์–ด ๋ฒ„์ „ ์˜ค๋ฅ˜

์— ๋งŒ๋“  2018๋…„ 12์›” 14์ผ  ยท  7์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: Baseflow/flutter-geolocator

๐Ÿ› ๋ฒ„๊ทธ ์‹ ๊ณ 

๋นŒ๋“œ ์˜ค๋ฅ˜

flutter  === BUILD TARGET permission_handler OF PROJECT Pods WITH CONFIGURATION Debug ===The โ€œSwift Language Versionโ€ (SWIFT_VERSION) build setting must be set to asupported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2.This setting can be set in the build settings editor

๋ฒ„์ „: 1.x

ํ”Œ๋žซํผ:
:์•„์ดํฐ: iOS

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

์—ฌ๊ธฐ์— ์ œ์•ˆ๋œ ๋Œ€๋กœ ios/Podfile ๋‹ค์Œ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ์ž‘๋™ํ•˜๊ฒŒ ํ–ˆ์Šต๋‹ˆ๋‹ค.

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

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.2'  # required
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

๋ชจ๋“  7 ๋Œ“๊ธ€

๋˜ํ•œ iOS ๊ธฐ๊ธฐ์—์„œ geolocator 2.1.1 ๋ฐ ๋‹ค์Œ flutter ๋ฒ„์ „์„ ์‚ฌ์šฉํ•˜์—ฌ ์‹คํ–‰/๋นŒ๋“œํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

Flutter 1.0.0 โ€ข channel beta โ€ข https://github.com/flutter/flutter.git
Framework โ€ข revision 5391447fae (5 weeks ago) โ€ข 2018-11-29 19:41:26 -0800
Engine โ€ข revision 7375a0f414
Tools โ€ข Dart 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

์‹ ์†ํ•œ --๋ฒ„์ „ ์ธ์‡„

Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
Target: x86_64-apple-darwin18.2.0

์ €๋Š” macOS 10.14.1 ์ž…๋‹ˆ๋‹ค.

์ƒˆ Flutter ํ”„๋กœ์ ํŠธ๋ฅผ ๋งŒ๋“ค๊ณ  AndroidManifest.xml ์— android.permission.ACCESS_FINE_LOCATION ๊ถŒํ•œ์„ ์ถ”๊ฐ€ํ•˜๊ณ  info.plist ์— NSLocationWhenInUseUsageDescription $ ๊ถŒํ•œ์„ ์ถ”๊ฐ€ํ•˜๊ณ  pubspec.yaml ์— geolocator: ^2.1.1 ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค. pubspec.yaml .

flutter run ์—์„œ ๋‹ค์Œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

Running pod install...                                       0.9s
CocoaPods' output:
โ†ณ
      Preparing

    Analyzing dependencies

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

    Finding Podfile changes
      A geolocator
      A google_api_availability
      A permission_handler
      - Flutter
      - path_provider
      - shared_preferences

    Fetching external sources
    -> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
    -> Fetching podspec for `geolocator` from `.symlinks/plugins/geolocator/ios`
    -> Fetching podspec for `google_api_availability` from `.symlinks/plugins/google_api_availability/ios`
    -> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
    -> Fetching podspec for `permission_handler` from `.symlinks/plugins/permission_handler/ios`
    -> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`

    Resolving dependencies of `Podfile`

    Comparing resolved specification to the sandbox manifest
      A Flutter
      A geolocator
      A google_api_availability
      A path_provider
      A permission_handler
      A shared_preferences

    Downloading dependencies

    -> Installing Flutter (1.0.0)

    -> Installing geolocator (2.1.1)

    -> Installing google_api_availability (1.0.4)

    -> Installing path_provider (0.0.1)

    -> Installing permission_handler (2.1.2)

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

     - `geolocator` 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.\n- `google_api_availability` 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.\n- `permission_handler` 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.

    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/installer/xcode/target_validator.rb:1
    15:in `verify_swift_pods_swift_version'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/installer/xcode/target_validator.rb:3
    7:in `validate!'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/installer.rb:443:in
    `validate_targets'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/installer.rb:124:in `install!'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/command/install.rb:48:in `run'
    /Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.0.beta.1/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:22:in `load'
    /usr/local/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

์—ฌ๊ธฐ์— ์ œ์•ˆ๋œ ๋Œ€๋กœ ios/Podfile ๋‹ค์Œ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ์ž‘๋™ํ•˜๊ฒŒ ํ–ˆ์Šต๋‹ˆ๋‹ค.

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

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.2'  # required
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

๋˜ํ•œ Cocoapod ๋ฒ„์ „ 1.5.3 ์ด ์„ค์น˜๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ตœ์‹  1.6 ๋ฒ ํƒ€ ๋ฒ„์ „์ด ์•„๋‹™๋‹ˆ๋‹ค.

๋„ค ์ €๋„์š”

๋‚˜๋Š” ํ•ด๊ฒฐ์ฑ…์„ ์ฐพ์•˜๊ณ ,
geolocator์™€ onesignal์„ ๋™์‹œ์— ์‚ฌ์šฉํ•˜๋ฉด ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜๊ณ ,
๋”ฐ๋ผ์„œ ์œ„์น˜ ์ •๋ณด๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ์œ„์น˜๋งŒ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

์ €๋Š” Cocoapod ๋ฒ„์ „ 1.6์„ ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. brew๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ Cocoapod ๋ฒ„์ „ 1.5.3์œผ๋กœ ๋‹ค์šด๊ทธ๋ ˆ์ด๋“œํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ๋ ค์ฃผ์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

์ด ๋ฐฉ๋ฒ•์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

์ €๋Š” Cocoapod ๋ฒ„์ „ 1.6์„ ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. brew๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ Cocoapod ๋ฒ„์ „ 1.5.3์œผ๋กœ ๋‹ค์šด๊ทธ๋ ˆ์ด๋“œํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ๋ ค์ฃผ์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

์ด ๋ฐฉ๋ฒ•์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

StackOverflow์—์„œ ๋‹ค์šด๊ทธ๋ ˆ์ด๋“œ์— ์œ ์šฉํ•œ ์ด ๋‹ต๋ณ€์„ ์ฐพ์•˜์Šต๋‹ˆ๋‹ค. https://stackoverflow.com/a/20489489/6348097

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰