Closed felpsio closed 5 years ago
I cloned the repository and I could make it working changing the geoflutterfire.podspec to:
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'geoflutterfire'
s.version = '0.0.1'
s.summary = 'A new Flutter plugin.'
s.swift_version = '4.2' #I added this line
s.description = <<-DESC
A new Flutter plugin.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.ios.deployment_target = '8.0'
end
Not sure if the 4.2 would be the best version to let on the package. If you think it is I can create a PR
Have the same issue, @felipecesar42 can you provide a step by step instruction how did you solve this issue. I have no clue how to clone and use such packages.
Thank in advanced
hi @ebastuart , use this in your pubspec temporally:
geoflutterfire:
git: https://github.com/felipecesar42/GeoFlutterFire.git
Probably it will be fixed on the next versions so you should come back to this repository to get the new updates of the package
thanks @felipecesar42
but it failed:
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/ebastuart/development/flutter/.pub-cache/git/GeoFlutterFire-b0d885a363d0ff1cab211905c95a0981940b6f7d/ios/Classes/GeoflutterfirePlugin.m:2:9: fatal error: 'geoflutterfire/geoflutterfire-Swift.h' file not found
#import <geoflutterfire/geoflutterfire-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
@ebastuart try to put this on your Podfile (ios/Podfile): use_frameworks!
Should look like this:
target 'Runner' do
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
use_frameworks! #:)
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
got a new error:
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
<unknown>:0: error: underlying Objective-C module 'geoflutterfire' not found
@ebastuart: I have no idea now. Can you try flutter clean, build and send the full error log + your podfile + flutter doctor + your pubspec (with only the relevant packages)?
hope anything helps
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
While building module 'GooglePlacePicker' imported from /Users/ebastuart/development/flutter/.pub-cache/hosted/pub.dartlang.org/google_places_picker-0.1.0/ios/Classes/GooglePlacesPickerPlugin.h:2:
While building module 'GooglePlaces' imported from /Users/ebastuart/Desktop/heme/ios/Pods/GooglePlacePicker/Frameworks/GooglePlacePicker.framework/Headers/GMSPlacePickerConfig.h:17:
In file included from <module-includes>:1:
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/GooglePlaces/Frameworks/GooglePlaces.framework/Headers/GooglePlaces.h:16:
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/GooglePlaces/Frameworks/GooglePlaces.framework/Headers/GMSPlacesClient.h:21:
/Users/ebastuart/Desktop/heme/ios/Pods/GooglePlaces/Frameworks/GooglePlaces.framework/Headers/GMSPlacesErrors.h:73:4: warning: HTML start tag prematurely ended, expected attribute name or '>' [-Wdocumentation]
* href="https://developers.google.com/places/ios-api/usage">usage limits guide</a> for more
^
/Users/ebastuart/Desktop/heme/ios/Pods/GooglePlaces/Frameworks/GooglePlaces.framework/Headers/GMSPlacesErrors.h:72:63: note: HTML tag started here
* the API that far exceeds normal request levels. See the <a
^
/Users/ebastuart/Desktop/heme/ios/Pods/GooglePlaces/Frameworks/GooglePlaces.framework/Headers/GMSPlacesErrors.h:82:4: warning: HTML start tag prematurely ended, expected attribute name or '>' [-Wdocumentation]
* href="https://developers.google.com/places/ios-api/usage">usage limits guide</a> for more
^
/Users/ebastuart/Desktop/heme/ios/Pods/GooglePlaces/Frameworks/GooglePlaces.framework/Headers/GMSPlacesErrors.h:81:63: note: HTML tag started here
* the API that far exceeds normal request levels. See the <a
^
2 warnings generated.
2 warnings generated.
2 warnings generated.
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/FIRStorage.m:20:
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/Private/FIRStorageReference_Private.h:17:
In file included from /Users/ebastuart/Desktop/heme/build/ios/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageReference.h:19:
In file included from /Users/ebastuart/Desktop/heme/build/ios/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorage.h:19:
/Users/ebastuart/Desktop/heme/build/ios/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageConstants.h:80:28: error: redefinition of 'FIRStorageTaskStatus'
typedef NS_ENUM(NSInteger, FIRStorageTaskStatus) {
^
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/FIRStorage.m:15:
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/Public/FIRStorage.h:19:
/Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/Public/FIRStorageConstants.h:80:28: note: previous definition is here
typedef NS_ENUM(NSInteger, FIRStorageTaskStatus) {
^
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/FIRStorage.m:20:
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/Private/FIRStorageReference_Private.h:17:
In file included from /Users/ebastuart/Desktop/heme/build/ios/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageReference.h:19:
In file included from /Users/ebastuart/Desktop/heme/build/ios/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorage.h:19:
/Users/ebastuart/Desktop/heme/build/ios/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageConstants.h:84:3: error: redefinition of enumerator 'FIRStorageTaskStatusUnknown'
FIRStorageTaskStatusUnknown,
^
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/FIRStorage.m:15:
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/Public/FIRStorage.h:19:
/Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/Public/FIRStorageConstants.h:84:3: note: previous definition is here
FIRStorageTaskStatusUnknown,
^
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/FIRStorage.m:20:
In file included from /Users/ebastuart/Desktop/heme/ios/Pods/FirebaseStorage/Firebase/Storage/Private/FIRStorageReference_Private.h:17:
In file included from /Users/ebastuart/Desktop/heme/build/ios/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageReference.h:19:
In file included from /Users/ebastuart/Desktop/heme/build/ios/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorage.h:19:
/Users/ebastuart/Desktop/heme/build/ios/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageConstants.h:89:3: error: redefinition of enumerator 'FIRStorageTaskStatusResume'
[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14.3 18D109, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[✓] VS Code (version 1.32.1)
[✓] Connected device (2 available)
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# 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
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
use_frameworks!
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
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
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
google_maps_flutter: ^0.4.0
image_picker: ^0.5.0+3
firebase_auth: ^0.8.1+4
cloud_firestore: ^0.9.5+2
firebase_storage: ^2.1.0+1
shared_preferences: ^0.5.1+1
connectivity: ^0.4.2
intl: ^0.15.7
google_places_picker: ^0.1.0
uuid: ^2.0.0
location: ^2.0.0
geoflutterfire:
git: https://github.com/felipecesar42/GeoFlutterFire.git
Looks like a problem of compatibility among firebase packages. I had lots of problems with the newest firestore packaged and downgraded. I suggest you to try to downgrade your packages too. The packages I'm using to handle location and database are:
firebase_auth: ^0.8.1+1
google_sign_in: ^4.0.1+1
flutter_facebook_login: ^1.2.0
cloud_firestore: ^0.9.0+2 #you have to run cd ios && pod update Firebase/Firestore
firebase_storage: ^2.1.0+1
geolocator: ^3.0.1
When using firebase it may need some additional configuration. You probably already did this, but, it's possible that you gonna have go check again
now it seems to working, thank you a lot @felipecesar42 for the workaround
You're welcome. Hope this troubleshoting helps more people :)
I cloned the repository and I could make it working changing the geoflutterfire.podspec to:
# # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'geoflutterfire' s.version = '0.0.1' s.summary = 'A new Flutter plugin.' s.swift_version = '4.2' #I added this line s.description = <<-DESC A new Flutter plugin. DESC s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' s.ios.deployment_target = '8.0' end
Not sure if the 4.2 would be the best version to let on the package. If you think it is I can create a PR
@felipecesar42 Could you create a PR pointing to the stable version?
Yes @DarshanGowda0 , just did :)
Thanks, @felipecesar42 😄
Not, not close please...
fatal error: 'geoflutterfire/geoflutterfire-Swift.h' it can not be compiled by taking user_frameworks! when firebase_message requires remove use_frameworks?
thanks!
I've got this error too, and when I add use_frameworks!
, it broke even more on my project.
any updates?
@dirathea it's working fine for me on the version: ^2.0.3+5
.
@felpsio I'm using geoflutterfire: 2.0.3+5 and getting the same error as @ebastuart
Xcode's output: ↳ /Users/kayes/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/geoflutterfire-2.0.3+5/ios/Classes/GeoflutterfirePlugin.m:2:9: fatal error: 'geoflutterfire/geoflutterfire-Swift.h' file not found
import <geoflutterfire/geoflutterfire-Swift.h>
I am however, using the following version of flutter packages: firebase_core: ^0.4.0 firebase_auth: ^0.11.0 cloud_firestore: ^0.12.7 firebase_storage: ^3.0.2 firebase_messaging: ^5.1.2
When I inlcude use_frameworks! I get a bunch of other errors.
Do I still need to downgrade these packages to the version you suggested back in march? Could you tell me which version of these packages are working for you?
If it helps this are the modifications I have in my Podfile
target 'Runner' do
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
use_frameworks! # I added this line
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '5' # I added this line
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
@felpsio Now I get the following error, any idea? I suspect that it maybe related to something else, so I'm googling around, but please let me know if you can see it's related to the changes above.
Launching lib/main.dart on iPhone X in debug mode... Xcode build done. 10.3s Failed to build iOS app Error output from Xcode build: ↳ 2019-08-08 18:09:51.102 xcodebuild[68282:360854] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-13231/DVTFoundation/Utilities/DVTFileSystemUtilities.mm:142 Details: lstat('/Users/kayes/Dev/MyApp/build/ios/Debug-iphonesimulator/nanopb/nanopb.framework') failed with errno 2 (No such file or directory) Function: DVTRecursiveMkdirResult dvt_recursiveMkdir_returningErrorString(NSString __strong, NSString __autoreleasing *) Thread: <NSThread: 0x7f8354296d60>{number = 14, name = (null)} Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide. BUILD FAILED Xcode's output: ↳ The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor. Could not build the application for the simulator. Error launching application on iPhone X. Exited (sigterm)
@Kayes-Islam are you sure you put the information correctly?
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
The text above makes me think if you didn't make a typing mistake
@felpsio Here is the content of my ios/Podfile after the modification, in case I missed something:
# platform :ios, '9.0'
# 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! # I added this line
# 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 pub 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
# 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'] = '5'
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
@Kayes-Islam your Podfile looks code. Maybe open XCode and try to change the minimum ios version to 10.0 or 11.0.
Success Story.
I had this issue again today when I added geoflutterfire for the first time to my project.
When I added geoflutterfire to my pubspec.yaml, I had to upgrade cloud_firestore in order for 'Packages get' to be able to solve for dependencies.
idk if this is exactly how to fix, but here is what I did.
These are my package versions. As previously mentioned, when I added geoflutterfire, I had to upgrade cloud_firestore
firebase_core: ^0.4.0+3 firebase_auth: ^0.14.0+5 cloud_firestore: ^0.13.0+1 geoflutterfire: ^2.0.3+8
I also added 'use frameworks' to the Podfile, but in retrospect, I'm not sure that was necessary.
Then:
Everything builds and runs!
Any time I've had to upgrade cloud_firestore, I've had build problems. IMO it's more about making sure that the ios Podfile is actually using the right versions of packages. The 'cd ios; pod update' is what does that.
I just add GeoFlutter Fire to my pubspec and started throwing build erros:
flutter doctor:
I tried the versions 2.0.0 - 2.0.3. My pubspec related to firebase/geolocation packages: