Closed icodelifee closed 1 year ago
Hi @icodelifee, thanks for using Patrol and creating this issue.
I haven't encountered this issue before. Could you create a minimal reproducible sample of this problem in a separate GitHub repo? It'd help a lot.
Hi @icodelifee, thanks for using Patrol and creating this issue.
I haven't encountered this issue before. Could you create a minimal reproducible sample of this problem in a separate GitHub repo? It'd help a lot.
Hey @bartekpacia, sorry for lack of more info but i did some digging and seems like issue is when you have both patrol and cloud_firestore in dependencies
if you test a project with both of them you will encounter this issue
dependencies:
flutter:
sdk: flutter
cloud_firestore: ^4.3.1
dev_dependencies:
flutter_test:
sdk: flutter
patrol:
Thanks for this info @icodelifee.
Are you using precompiled Firestore iOS SDKs? I am and I see no problems in the app on which I tried to reproduce this issue. It should also greatly reduce your build times :)
Yea i know about the precompiled. if i use precompiled sdk, my app crashes on launch, i think it might be an issue with m1 pro cpus
Thanks for this info @icodelifee.
Are you using precompiled Firestore iOS SDKs? I am and I see no problems in the app on which I tried to reproduce this issue. It should also greatly reduce your build times :)
Not sure what the issue is here
No idea as well. But what did you do?
No idea as well. But what did you do?
Nothing, other than just running the app using the precompiled sdk
I have created an issue at firestore-ios-sdk-frameworks(#69), for now i'll just be testing patrol on android.
Can you attach the whole logs?
Can you attach the whole logs?
Same issue. Here are my logs when running the following command:
flutter clean && flutter pub get && pod install --verbose
dependencies:
flutter:
sdk: flutter
# UI
auto_size_text: ^3.0.0
auto_route: ^5.0.2
pretty_qr_code: ^2.0.2
qr_code_scanner: ^1.0.1
fl_chart: ^0.55.2
dotted_line: ^3.1.0
better_player: ^0.0.83
iconsax: ^0.0.8 # TODO: Remove after icon implementation
flutter_svg: ^1.1.5 # TODO: User only zoi image
cached_network_image: ^3.2.2
smooth_page_indicator: ^1.0.0+2
flutter_sticky_header: ^0.6.4
confetti: ^0.7.0
rive: ^0.9.1
carousel_slider: ^4.1.1
pull_down_button: ^0.5.0
# Architecture
flutter_bloc: ^8.1.1
get_it: ^7.2.0
freezed_annotation: ^2.2.0
json_annotation: ^4.7.0
# Web3
erc20: ^1.0.0
web3dart: 2.3.5
ed25519_hd_key: ^2.2.0
solana: ^0.26.1
hex: ^0.2.0
bip39: ^1.0.6
eth_sig_util: ^0.0.9
wallet_connect: ^1.0.2
# Compliance
# flutter_idensic_mobile_sdk_plugin: ^1.20.0
# Firebase
firebase_core: ^2.4.1
cloud_firestore: ^4.3.1
firebase_auth: ^4.2.5
firebase_dynamic_links: ^5.0.11
firebase_analytics: ^10.1.0
firebase_messaging: ^14.2.1
firebase_crashlytics: ^3.0.11
firebase_storage: ^11.0.10
firebase_app_check: ^0.1.1+8
firebase_remote_config: ^3.0.9
# Auth
google_sign_in: ^5.4.2
sign_in_with_apple: ^4.1.0
crypto: ^3.0.2
# flutter_facebook_auth: ^4.3.4+2
# Network
dio: ^4.0.6
http: ^0.13.5
algolia_helper_flutter: ^0.2.1
# Utilities
open_store: ^0.4.0
version: ^3.0.2
pay: ^1.0.11
rxdart: ^0.27.5
convert: ^3.0.2
# new_version: ^0.3.1
device_info_plus: ^8.0.0
package_info_plus: ^3.0.1
open_mail_app: ^0.4.5
local_auth: ^2.1.2
shared_preferences: ^2.0.15
share: ^2.0.4
url_launcher: ^6.1.6
encrypt: ^5.0.1
jwt_decode: ^0.3.1
intercom_flutter: ^7.5.0
permission_handler: ^10.2.0
in_app_update: ^3.0.0
in_app_review: ^2.0.4
timeago: ^3.3.0
flutter_countdown_timer: ^4.1.0
duration: ^3.0.12
logger: ^1.1.0
injectable: ^1.5.3
video_player: ^2.4.7
camera: ^0.10.0+3
mime_type: ^1.0.0
uuid: ^3.0.6
# Misc
intl: ^0.17.0
collection: ^1.16.0
flutter_native_splash: ^2.2.14
# Analytics
# flutter_uxcam: ^2.1.1
appsflyer_sdk: ^6.8.2
flutter_segment: ^3.12.1
# Security
flutter_secure_storage: ^6.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
integration_test:
sdk: flutter
freezed: ^2.1.0+1
auto_route_generator: ^5.0.2
build_runner: ^2.2.1
flutter_lints: ^2.0.1
flutter_launcher_icons: ^0.10.0
mockito: ^5.3.2
firebase_auth_mocks: ^0.9.0
injectable_generator: ^1.5.4
json_serializable: ^6.5.4
bloc_test: ^9.1.0
patrol: ^0.10.8
Hi @jacobokoenig, can you edit your message to include the command you invoked and also include the whole logs?
Same issue. Here are my logs:
[!] The 'Pods-Runner' target has frameworks with conflicting names: grpc.
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/target_validator.rb:67:in
verify_no_duplicate_names' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/target_validator.rb:54:in
block (2 levels) in verify_no_duplicate_framework_and_library_names' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/target_validator.rb:48:ineach_key' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/target_validator.rb:48:in
block in verify_no_duplicate_framework_and_library_names' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/target_validator.rb:47:ineach' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/target_validator.rb:47:in
verify_no_duplicate_framework_and_library_names' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/target_validator.rb:37:invalidate!' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:597:in
validate_targets' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:163:ininstall!' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in
run' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:inrun' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in
run' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in<top (required)>' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in
load' /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `'
just use the pre compiled firebase sdk, it solves the issue
Updated @bartekpacia
@icodelifee can you clarify or explain how I can do this?
@jacobokoenig I'm pretty sure they mean this: https://github.com/invertase/firestore-ios-sdk-frameworks
Let me know if this helps you.
@jacobokoenig Did you try using the precompiled Firebase SDKs?
hello @bartekpacia i really have no idea whats wrong with precomiled Firebase SDKs, can you explain it to me ? i try to remove all of my precompile SDKs and it's still giving me an error when running pod update
or pod install
on my project
apple@ip-192-168-1-2 ios % pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
firebase_auth: Using Firebase SDK version '10.3.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '10.3.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '10.3.0' defined in 'firebase_core'
firebase_remote_config: Using Firebase SDK version '10.3.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "patrol":
In Podfile:
patrol (from `.symlinks/plugins/patrol/ios`)
Specs satisfying the `patrol (from `.symlinks/plugins/patrol/ios`)` dependency were found, but they required a higher minimum deployment target.
Hi @dwievermos,
I get this problem sometimes as well – it usually means that the version of precompiled Firebase SDKS that you defined in Podfile
isn't compatible with the versions of Firebase Dart packages defined in pubspec.yaml
.
I recommend you makes sure you're using the latest.
For example, here're the versions I use in my private app 😁:
pod 'FirebaseFirestore', git: 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', tag: '10.3.0'
and:
cloud_firestore: 4.3.1
firebase_auth: 4.2.5
firebase_core: 2.4.1
firebase_crashlytics: 3.0.11
firebase_storage: 11.0.10
PS Mind the lack of ^
before Dart packages versions - this force pub
to use this exact version. Learn more here.
hello, thanks for the fast response @bartekpacia I try to add a line on my Podfile
& change my dependency versions as you refer to without the caret as well. Unfortunately, the error still occurs. I think I will dig into this problem, and waiting for the others to come with solution
pod 'FirebaseFirestore', git: 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', tag: '10.3.0'
And
cloud_firestore: 4.3.1
firebase_auth: 4.2.5
firebase_core: 2.4.1
firebase_remote_config: 3.0.9
firebase_messaging: 14.2.1
hello @bartekpacia i really have no idea whats wrong with precomiled Firebase SDKs, can you explain it to me ? i try to remove all of my precompile SDKs and it's still giving me an error when running
pod update
orpod install
on my projectapple@ip-192-168-1-2 ios % pod update Update all pods Updating local specs repositories Analyzing dependencies firebase_auth: Using Firebase SDK version '10.3.0' defined in 'firebase_core' firebase_core: Using Firebase SDK version '10.3.0' defined in 'firebase_core' firebase_messaging: Using Firebase SDK version '10.3.0' defined in 'firebase_core' firebase_remote_config: Using Firebase SDK version '10.3.0' defined in 'firebase_core' [!] CocoaPods could not find compatible versions for pod "patrol": In Podfile: patrol (from `.symlinks/plugins/patrol/ios`) Specs satisfying the `patrol (from `.symlinks/plugins/patrol/ios`)` dependency were found, but they required a higher minimum deployment target.
Had the same problem as you, but bumping my iOS deployment target to 16.2 for my Pods project in Xcode solved the problem.
Some discussion in grpc-swift: https://github.com/grpc/grpc-swift/issues/915
As workaround here works for me:
1. Download our current Podspec from https://github.com/grpc/grpc-swift/raw/main/gRPC-Swift.podspec and place it next to your Podfile.
2. In the downloaded gRPC-Swift.podspec, replace s.module_name = 'GRPC' with s.module_name = 'GRPC_Swift'.
3. Include the dependency in your Podfile as follows: pod 'gRPC-Swift', :podspec => 'gRPC-Swift.podspec'
I do use link https://github.com/grpc/grpc-swift/blob/1.8.0/gRPC-Swift.podspec to download the gRPC-Swift.podspec file and update the version to 1.8. Seems the latest version has dropped cocoapods support ???
---- update
Sorry, this only fix the pod install, but when compiling got error:
/Users/riverhuang/.pub-cache/hosted/pub.dartlang.org/patrol-1.0.7/ios/Classes/AutomatorServer/AutomatorServer.swift:2:8: error: no such module 'GRPC'
import GRPC
of course since I change the module name. So fall back to FirebaseFirestore prebuild binary warkaround.
Will it solve the problem if patrol upgrade to latest grpc-swift using SPM?
@river2202 I don't know – does SPM even work with Flutter (which uses CocoaPods as its default package manager on iOS)? Looks like it does not.
Hi Is there any updates?
Simplest solution: Go to the example project in the dir: https://github.com/leancodepl/patrol/blob/master/packages/patrol/example/ios/Podfile
then copy the lines 2 and 3:
ios_deployment_target = '13.0'
platform :ios, ios_deployment_target
Replace in your ios/Podfile lines 2 and 3 with this
@river2202 @icodelifee Podfile fix working for me:
grpc_swift_override_name = 'Custom_Name'
pre_install do |installer|
patrol_pod = installer.pod_targets.find{|target| target.name == 'patrol'}
grpc_swift_pod = installer.pod_targets.find{|target| target.name == 'gRPC-Swift'}
next if patrol_pod.nil? || grpc_swift_pod.nil?
grpc_swift_pod.root_spec.module_name = grpc_swift_override_name
patrol_srcroot_dir = patrol_pod.pod_target_srcroot
symlink_patrol_dir = File.dirname(File.expand_path(patrol_srcroot_dir))
pub_cache_patrol_dir = File.readlink(symlink_patrol_dir)
File.unlink(symlink_patrol_dir)
FileUtils.cp_r(pub_cache_patrol_dir, symlink_patrol_dir)
Dir.glob("#{symlink_patrol_dir}/**/*.swift").each do |file_path|
content = File.read(file_path).gsub(/(\s)GRPC([\s.])/, "\\1#{grpc_swift_override_name}\\2")
File.open(file_path, 'w') {|file| file.write(content)}
end
end
@river2202 @icodelifee Podfile fix working for me:
grpc_swift_override_name = 'Custom_Name' pre_install do |installer| patrol_pod = installer.pod_targets.find{|target| target.name == 'patrol'} grpc_swift_pod = installer.pod_targets.find{|target| target.name == 'gRPC-Swift'} next if patrol_pod.nil? || grpc_swift_pod.nil? grpc_swift_pod.root_spec.module_name = grpc_swift_override_name patrol_srcroot_dir = patrol_pod.pod_target_srcroot symlink_patrol_dir = File.dirname(File.expand_path(patrol_srcroot_dir)) pub_cache_patrol_dir = File.readlink(symlink_patrol_dir) File.unlink(symlink_patrol_dir) FileUtils.cp_r(pub_cache_patrol_dir, symlink_patrol_dir) Dir.glob("#{symlink_patrol_dir}/**/*.swift").each do |file_path| content = File.read(file_path).gsub(/(\s)GRPC([\s.])/, "\\1#{grpc_swift_override_name}\\2") File.open(file_path, 'w') {|file| file.write(content)} end end```
This fix is also working for me. Otherwise, while using precompiled Firestore, the Runner instantly crashes with:
Termination Reason: DYLD 1 Library missing Library not loaded: @rpath/GRPC.framework/GRPC
@Codeaview Check your Target Dependencies in Build phases (on your test target), include something similar to Runner (maybe you have services that are used native GRPC library)
FYI: https://github.com/leancodepl/patrol/issues/1660#issuecomment-1693355936
Once we're done with it, the workarounds shouldn't be needed.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.
Adding the latest version of
patrol [^0.10.6]
to dev_dependencies and running pod install causes the error below.[!] The 'Pods-Runner' target has frameworks with conflicting names: grpc.
Full error log : https://katb.in/vagejozupem