pichillilorenzo / flutter_appavailability

A Flutter plugin that allows you to check if an app is installed/enabled, launch an app and get the list of installed apps.
https://pub.dartlang.org/packages/flutter_appavailability
MIT License
92 stars 89 forks source link

No platform was specified #6

Open BriscoPeas93 opened 5 years ago

BriscoPeas93 commented 5 years ago

The plugin is working perfectly on android. but when I try to run the app on IOS it fails.

[!] Automatically assigning platformioswith version9.1on targetRunnerbecause no platform was specified. Please specify a platform for this target in your Podfile. Seehttps://guides.cocoapods.org/syntax/podfile.html#platform.

Help please.

CampbellJCravens commented 5 years ago

I am having the same error for iOS

lauralarez commented 5 years ago

Hi, I had the same issue, I fixed it by adding this to the podfile on iOS/Runner:

use_frameworks! #on top of the file

pre_install do |installer|
  installer.analysis_result.specifications.each do |s|
    s.swift_version = '4.1' unless s.swift_version
  end
end

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true

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

Code from https://github.com/pichillilorenzo/flutter_inappbrowser/issues/15#issuecomment-454083666

CampbellJCravens commented 5 years ago

Thanks for your message!

Sadly the issue is still happening for me. I tried adding your code in many different spots in the Podfile, but none of them worked. I continue to get these this error:

[!] Unable to determine Swift version for the following pods:

I would have thought your solution to add config.build_settings['SWIFT_VERSION'] = '4.1' # required by simple_permission would have resolved this, however it doesn’t seem to be resolving it for me after all.

Again I really appreciate your help!

On Jul 30, 2019, at 8:57 AM, lauralarez notifications@github.com wrote:

Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.

install! 'cocoapods', :disable_input_output_paths => true

vikasbaru commented 4 years ago

Thanks for your message! Sadly the issue is still happening for me. I tried adding your code in many different spots in the Podfile, but none of them worked. I continue to get these this error: [!] Unable to determine Swift version for the following pods: - ‘flutter_appavailability’ 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. I would have thought your solution to add config.build_settings['SWIFT_VERSION'] = '4.1' # required by simple_permission would have resolved this, however it doesn’t seem to be resolving it for me after all. Again I really appreciate your help! On Jul 30, 2019, at 8:57 AM, lauralarez @.***> wrote: # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. install! 'cocoapods', :disable_input_output_paths => true

Did you find the solution?

samlotti commented 4 years ago

I also have this issue. I tried adding the following to the pod file but doesn't help:

use_frameworks!   # At the top of the file

pre_install do |installer|
  installer.analysis_result.specifications.each do |s|
    s.swift_version = '4.2' unless s.swift_version
  end
end

# in post install added this
config.build_settings['SWIFT_VERSION'] = '4.2'

Running xcode 11.1