Flutter: Unable to remove custom plugin from being included in ios app - ios

I wrote a custom flutter plugin for windows which works fine so far.
For some reason though, flutter keeps including the plugin in the ios build when I'm trying to run it on the iphone simulator. This causes errors because the plugin doesn't have a ios implementation.
On Android everything works fine.
Here is the plugins pubspec.yaml:
name: fbfunctions
description: A new flutter plugin project.
environment:
sdk: ">=2.7.0 <3.0.0"
flutter: ">=1.10.0"
dependencies:
flutter:
sdk: flutter
flutter:
plugin:
platforms:
windows:
pluginClass: FbfunctionsPlugin
And here is the error I get when trying to run on the ios simulator:
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install... 2.5s
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (`arm64`)
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
-> Fetching podspec for `cloud_firestore_web` from `.symlinks/plugins/cloud_firestore_web/ios`
-> Fetching podspec for `cloud_functions` from `.symlinks/plugins/cloud_functions/ios`
-> Fetching podspec for `cloud_functions_web` from `.symlinks/plugins/cloud_functions_web/ios`
-> Fetching podspec for `fbfunctions` from `.symlinks/plugins/fbfunctions/ios`
[!] No podspec found for `fbfunctions` in `.symlinks/plugins/fbfunctions/ios`
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/external_sources/path_source.rb:14:in `block in fetch'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:980:in `fetch_external_source'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:959:in `block (2 levels) in fetch_external_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:958:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:958:in `block in fetch_external_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:957:in `fetch_external_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:410:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:234:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
Error output from CocoaPods:
↳
[!] Automatically assigning platform `iOS` with version `10.1` 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 11 Pro Max.
How do I prevent flutter from trying to include the plugin in the ios build?

You can't; currently Flutter expects every plugin to have an iOS podspec. Until that is resolved, the workaround is to include a dummy ios/your_plugin_name.podspec, as you can see in federated flutter/plugins plugins.
You don't need anything in the folder other than the podspec, and once the issue is fixed you can remove it.

Related

How to obfuscate Cordova app for ios build?

I want to obfuscate my cordova app for ios build. My android build is automatically obfuscated with R8 tool. I am looking for an open source solution. I have tried using this tool - SiriusObfuscator
But I am getting an error-
$ Obfuscator_2018-04-24_115109 % bin/sirius -projectrootpath /Users/.../MyApp.xcodeproj -obfuscatedproject /Users/.../Desktop
===========================
Welcome to Sirius - Swift Obfuscator
===========================
1) File Extractor:
⠂⠁⠂⠄⡀⢀⠠⠐⠈⠁⠂⠄⡀⢀⠠⠐Extracting⠂⠁⠂⠄⡀⢀⠠⠐⠈⠁⠂⠄⡀⢀⠠⠐
STDERR: /Users/.../Downloads/Obfuscator_2018-04-24_115109/bin/lib/vendor/ruby/2.2.0/gems/xcodeproj-1.5.3/lib/xcodeproj/project.rb:217:in `initialize_from_file': [Xcodeproj] Unknown object version. (RuntimeError)
from /Users/.../Downloads/Obfuscator_2018-04-24_115109/bin/lib/vendor/ruby/2.2.0/gems/xcodeproj-1.5.3/lib/xcodeproj/project.rb:102:in `open'
from /Users/.../Downloads/Obfuscator_2018-04-24_115109/bin/lib/file-extractor/lib/file-extractor/xcodeproj_extractor.rb:10:in `initialize'
from /Users/.../Downloads/Obfuscator_2018-04-24_115109/bin/lib/file-extractor/lib/file-extractor/data_extractor.rb:24:in `new'
from /Users/.../Downloads/Obfuscator_2018-04-24_115109/bin/lib/file-extractor/lib/file-extractor/data_extractor.rb:24:in `extract_data_from_all_sources'
from /Users/.../Downloads/Obfuscator_2018-04-24_115109/bin/lib/file-extractor/lib/file-extractor/data_extractor.rb:11:in `extract_data'
from /Users/.../Downloads/Obfuscator_2018-04-24_115109/bin/lib/file-extractor/lib/file-extractor/command.rb:108:in `run'
from /Users/.../Downloads/Obfuscator_2018-04-24_115109/bin/lib/vendor/ruby/2.2.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
from /Users/.../Downloads/Obfuscator_2018-04-24_115109/bin/lib/file-extractor/lib/file-extractor/command.rb:76:in `run'
from /Users/.../Downloads/Obfuscator_2018-04-24_115109/bin/lib/file-extractor/bin/file-extractor:20:in `<main>'
STDOUT:
===========================
2) Symbol Extractor:
⠂⠁⠂⠄⡀⢀⠠⠐⠈⠁⠂⠄⡀⢀⠠⠐Extracting⠂⠁⠂⠄⡀⢀⠠⠐⠈⠁⠂⠄⡀⢀⠠⠐
STDERR: Error during JSON file read
STDOUT: Swift obfuscator symbol extractor tool
My cordova version - 10.0.0
Swift code developed is of 3.x version.
I have also read this SO post where someone pointed how obfuscating only Objective C code will cause issues with Cordova app.
Please help.

Fails to compile for IOS using Codemagic

I'm having trouble trying to compile on code magic, I don't have access to an Apple device. Can you tell me how to fix it?
I saw that to fix this problem I would have to perform these steps: Open [YourProject]/ios/Podfile and remove the # sign from platform :ios, '9.0' and try flutter run. If it doesn't work increase the version number for example to 10.0
as per the link: Error running pod install - Automatically assigning platform `iOS` with version `8.0` on target `Runner`
But how to resolve this in codemagic without macOS.
LOG ERROR IN CODEMAGIC:
== Building for iOS ==
> flutter build ios --debug --no-codesign
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.example.jumilAssistencia for device (ios)...
Running pod install... 4.9s
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
firebase_core: Using Firebase SDK version '8.3.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_messaging` from `.symlinks/plugins/firebase_messaging/ios`
firebase_messaging: Using Firebase SDK version '8.3.0' defined in 'firebase_core'
-> Fetching podspec for `geocoder` from `.symlinks/plugins/geocoder/ios`
-> Fetching podspec for `google_maps_flutter` from `.symlinks/plugins/google_maps_flutter/ios`
-> Fetching podspec for `location` from `.symlinks/plugins/location/ios`
-> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
-> Fetching podspec for `qr_code_scanner` from `.symlinks/plugins/qr_code_scanner/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
-> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`
Resolving dependencies of `Podfile`
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
CDN: trunk Relative path downloaded: CocoaPods-version.yml, save ETag: "612aa752-3d"
CocoaPods 1.11.0.rc.1 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.11.0.rc.1
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
[!] CocoaPods could not find compatible versions for pod "firebase_core":
In Podfile:
firebase_core (from `.symlinks/plugins/firebase_core/ios`)
Specs satisfying the `firebase_core (from `.symlinks/plugins/firebase_core/ios`)` dependency were found, but they required a higher minimum deployment target.
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:94:in `resolve'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/Users/builder/.rbenv/versions/2.7.2/bin/pod:23:in `load'
/Users/builder/.rbenv/versions/2.7.2/bin/pod:23:in `<main>'
Error output from CocoaPods:
↳
[!] Automatically assigning platform `iOS` with version `9.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
Build failed :|
Failed to build for iOS
You can access a codemagic own Macs during build via ssh or vnc, see the docs here. But I would personally just create a new flutter project and use the ios folder with all the configurations up to date. I recently set up CD through codemagic using a Flutter 2.2 generated ios config and had no issues.

The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (.../ios/Flutter/Flutter.framework)

After upgrading to flutter version 1.17.4 when running flutter build ios I get following output:
[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (.../ios/Flutter/Flutter.framework)
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:84:in `block (2 levels) in verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:74:in `each_key'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:74:in `block in verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:73:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:73:in `verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:38:in `validate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:590:in `validate_targets'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:158:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
Error running pod install
What I tried:
Deleting ios/Flutter/Flutter.framework and running pod install as suggested here didn't help
Adding s.static_framework = true to Flutter.podspec - no luck
Deleting-recreating ios folder - no luck
Commenting out use_frameworks! in Podfile - leads to errors in plugins like fatal error: '..._plugin-Swift.h' file not found
I also tried to downgrade the flutter as I didn't have any problem with prev one. But running flutter version v1.17.2 resulted in error:
Error: ProcessException: Process exited abnormally:
error: unsupported sort specification 'creatordate'
I'm stuck with this.
If this issue occured while you trying to implement your own flutter plugin, then simply add this line below dependencies to .podspec
s.static_framework = true
I get same problem with this error output:
[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries:
(/.../ios/Flutter/Flutter.framework)
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:84:in `block (2 levels) in
verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:74:in `each_key'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:74:in `block in verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:73:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:73:in `verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:38:in `validate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:595:in `validate_targets'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:162:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
I have solved problem with tried this step:
Open your folder ios in your project and open Podfile and you will see code like this:
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
You can remove code use_frameworks! and use_modular_headers! and this is complete code:
target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
If you have follow instruction you can save change file and hit flutter run
This is complete output:
Running pod install... 3.1s
Running Xcode build...
└─Compiling, linking and signing... 28.0s
Xcode build done. 73.0s
Waiting for iPhone 12 Pro Max to report its views... 19ms
Syncing files to device iPhone 12 Pro Max... 1,218ms
Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h Repeat this help message.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
An Observatory debugger and profiler on iPhone 12 Pro Max is available at: http://127.0.0.1:50854/VhaUEREqLb0=/
*Disclaimer:
I'm quite new to programming & coding and Flutter is my first programming language. But having struggled with this for 3 days, I believe I have fixed my code. Hoping this helps. Please excuse if this doesn't make sense.
Other Newbies reading this: Do this only if you have a backup of your script, and all of above solutions failed for you.*
Background
My problem occurred when I upgraded Xcode to 12.0.1. Got the same error:
The 'Pods-Runner' target has transitive dependencies that include statically linked binaries:
I believe in the upgrade process, some link in an unknown location broke between Flutter, Cocoa-pods & Xcode. I wasn't sure whether something broke internally within my project or within the platforms. Hence, I launched a new flutter project and confirmed it was the latter when that brand new project failed to launch on the Simulator.
Solution
My solution was to rejig the whole platform architecture, rather than re-writing the whole app code.
Step 1: Take a backup of your code (I didn't; got lucky or was just tired with the multiple iterations & backups.)
Step 2: Uninstalled Flutter (Restarted the Mac) and then Reinstalled Flutter on VSCODE
Step 3: Completely Uninstalled Cocoa-pods & Reinstalled Cocoapods. Followed the steps mentioned here.
[Now in your Project]
Step 4: In the terminal, type 'flutter clean' to clean all caches pre-built for the project
Step 5: Delete (or Rename) '/ios' folder (to something else like '/111ios')
Step 6: Recreate a new /ios folder. In the terminal, type
flutter create -i swift
You might need to specify your root PWD for the command to build the ios folder in the right directory.
Step 7: Get packages
flutter pub get
Step 8: Flutter Run.
The above got my boat sailing again. Hopefully this helps the community!

Flutter error on pod install: CocoaPods could not find compatible versions for pod "Firebase/CoreOnly"

My Flutter app is not working on my iOS device, while it's working perfectly on android. I'm getting an error on pod install
This is the output of pod install --verbose
alyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Using `ARCHS` setting to build architectures of target `Pods-OneSignalNotificationServiceExtension`: (``)
Finding Podfile changes
A contacts_service
A firebase_auth
A flutter_crashlytics
A local_auth
A onesignalflutter
A path_provider
A permission
A sqflite
A url_launcher
- Flutter
- OneSignal
- cloud_functions
- firebase_core
Fetching external sources
-> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
-> Fetching podspec for `cloud_functions` from `.symlinks/plugins/cloud_functions/ios`
-> Fetching podspec for `contacts_service` from `.symlinks/plugins/contacts_service/ios`
-> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
-> Fetching podspec for `flutter_crashlytics` from `.symlinks/plugins/flutter_crashlytics/ios`
-> Fetching podspec for `local_auth` from `.symlinks/plugins/local_auth/ios`
-> Fetching podspec for `onesignalflutter` from `.symlinks/plugins/onesignalflutter/ios`
-> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
-> Fetching podspec for `permission` from `.symlinks/plugins/permission/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`
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In snapshot (Podfile.lock):
Firebase/CoreOnly (= 5.20.2)
In Podfile:
firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) was resolved to 0.0.1, which depends on
Firebase/Auth (~> 6.0) was resolved to 6.0.0, which depends on
Firebase/CoreOnly (= 6.0.0)
It seems like you've changed the constraints of dependency `Firebase/CoreOnly` inside your development pod `firebase_auth`.
You should run `pod update Firebase/CoreOnly` to apply changes you've made.
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:257:in `process_topmost_state'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/resolver.rb:91:in `resolve'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:909:in `block in resolve_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:907:in `resolve_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/analyzer.rb:114:in `analyze'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:266:in `analyze'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:174:in `block in resolve_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:173:in `resolve_dependencies'
/usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:136: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>'
[!] 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`.
[!] Automatically assigning platform `ios` with version `10.0` on target `OneSignalNotificationServiceExtension` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
And this is my Podfile:
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
end
}
return pods_ary
end
target 'Runner' do
use_frameworks!
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
# Flutter Pods
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
if generated_xcode_build_settings.empty?
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
end
generated_xcode_build_settings.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join('.symlinks', 'flutter')
File.symlink(File.dirname(p[:path]), symlink)
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
end
}
# Plugin Pods
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
pod p[:name], :path => File.join(symlink, 'ios')
}
end
target 'OneSignalNotificationServiceExtension' do
use_frameworks!
pod 'OneSignal', '>= 2.9.3', '< 3.0'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
And this is my pubspec.yaml:
name: kvote_app
description: A new Flutter application.
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# Read more about versioning at semver.org.
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_bloc: any
color: any
http: any
equatable: any
# permission_handler: ^2.1.2
cloud_functions: ^0.3.0
firebase_auth: ^0.11.0
font_awesome_flutter: any
fancy_bottom_navigation: any
permission: any
contacts_service: any
local_auth: any
sqflite: any
path_provider: any
auto_size_text: any
flutter_crashlytics: any
url_launcher: any
rflutter_alert: any
onesignalflutter:
git: git://github.com/jmrobles/OneSignal-Flutter-SDK.git
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/avatar.png
- assets/logo.png
- assets/img/login_logo.png
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.io/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.io/custom-fonts/#from-packages
fonts:
- family: WorkSansSemiBold
fonts:
- asset: assets/fonts/Work_Sans/WorkSans-SemiBold.ttf
- family: WorkSansBold
fonts:
- asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf
- family: WorkSansMedium
fonts:
- asset: assets/fonts/Work_Sans/WorkSans-Medium.ttf
The error is happening mainly because of a conflict between cloud functions and authentication firebase libraries.
I'm totally new to the pod, and can't seem to find a solution online of my case. I've tried the answer from https://stackoverflow.com/a/40102370 but it did not work.
Any recommendations on how to fix this?
Go to your flutter project. Navigate to ios and open Podfile Replace the second line of that file with this:
platform :ios, '10.0'
simple_permissions doesn't work for iOS versions below 10.0
It worked for me after delete Podfile.lock file and Pod directory, and again install pod manually using pod install command.
Try to use these command in terminal :
rm -rf ~/.cocoapods/repos
pod setup
uncomment the ios version from the podfile
platform :ios, '9.0' // ios/Pods/podfile
and then install the pods using
pod install
and then try running the app
Changed this from platform :ios, '9.0' // ios/Pods/podfile
to platform :ios, '10.0' // ios/Pods/podfile
And it worked for me. Thanks, Guys.
I have the same issue.
You should not let pubspec.yaml versions set to "any". After resolving the versions, you should fix it to have it stable.
It worked for me after
step 1. delete Podfile.lock file and Pod directory
step 2.pod install --repo-update
step3. pod update Firebase/CoreOnly
For me, I just run this command, and its fixed: pod install --repo-update
Simply uncommenting line 2 of Podfile worked for me.

Conflict between location and url_launcher plugin

I'm developing an app which finds points of interest around the location of the user. To get the location of the user I use the location plugin which works quite nicely.
The next thing I'd like to implement is a button to open the default mapping application to navigate the user to the POI. I went at it using the url_launcher plugin and the geo: url scheme for android and the maps: scheme for iOS.
Independent of each other both plugins work as expected. Once I had both plugins in my project the problems started. Using the default setup of flutter create I get the following error:
Launching lib/main.dart on iPhone 6 in debug mode...
Running pod install...
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (`arm64`)
Finding Podfile changes
- Flutter
- location
- url_launcher
Fetching external sources
-> Fetching podspec for `Flutter` from `/Users/rainerwittmann/Flutter/flutter/bin/cache/artifacts/engine/ios`
-> Fetching podspec for `location` from `/Users/rainerwittmann/.pub-cache/hosted/pub.dartlang.org/location-1.0.2/ios`
-> Fetching podspec for `url_launcher` from `/Users/rainerwittmann/.pub-cache/hosted/pub.dartlang.org/url_launcher-0.4.2+1/ios`
Resolving dependencies of `Podfile`
Comparing resolved specification to the sandbox manifest
- Flutter
- location
- url_launcher
Downloading dependencies
-> Using Flutter (1.0.0)
-> Using location (0.0.1)
-> Using url_launcher (0.0.1)
- Running pre install hooks
[!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfile or target to opt into using it. The Swift Pod being used is: location
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:448:in `block (2 levels) in verify_framework_usage'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:443:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:443:in `block in verify_framework_usage'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:440:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:440:in `verify_framework_usage'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:114:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command/install.rb:37:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command.rb:50:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
Error running pod install
Error launching application on iPhone 6.
So far so good. Adding use_frameworks! to my podfile, as suggested by the error message resulted in another error:
Launching lib/main.dart on iPhone 6 in debug mode...
Running pod install...
Running Xcode build...
Failed to build iOS app
Error output from Xcode build:
↳
** CLEAN FAILED **
The following build commands failed:
Check dependencies
(1 failure)
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Xcode's output:
↳
Build settings from command line:
ARCHS = x86_64
BUILD_DIR = /Users/rainerwittmann/Flutter/zapfsuche/build/ios
ONLY_ACTIVE_ARCH = YES
SDKROOT = iphonesimulator10.3
=== CLEAN TARGET location OF PROJECT Pods WITH CONFIGURATION Release ===
Check dependencies
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
=== CLEAN TARGET url_launcher OF PROJECT Pods WITH CONFIGURATION Release ===
Check dependencies
=== BUILD TARGET url_launcher OF PROJECT Pods WITH CONFIGURATION Release ===
Check dependencies
=== BUILD TARGET location OF PROJECT Pods WITH CONFIGURATION Release ===
Check dependencies
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
Could not build the application for the simulator.
Error launching application on iPhone 6.
Unfortunately I have no idea how to proceed from here. Can somebody help me sort this out?
Note
This problem only exists on iOS. Both plugins work like a charm on android.
Swift plugins require use_frameworks! and that isn't fully supported yet.
I'm currently working on it. Thanks for your patience!
Edit Podfile
Add/uncomment after "target 'Runner' do" line number ~35
use_frameworks!
Then add this line after line number ~67
config.build_settings['SWIFT_VERSION'] = '4.0'
Example:
target 'Runner' do
** use_frameworks! **
........ ......
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
** config.build_settings['SWIFT_VERSION'] = '4.0' **
end
end
end
delete your Podfile.lock and try.

Resources