Firebase插件未在ios上构建 我试图在扑朔迷离中使用Firebase核心,Firebase数据库,Firebase身份验证,Cloud Firestore来构建应用程序,所以出现了这个错误 其中:FirebaseAuthPlugin.m,FIRUser.h,Firebase.h 我试过删除podfile.lock,Runner.xcworkspace,然后轻扫干净,但无济于事...
构建失败错误:
mds-MacBook-Pro:analise_test mdtaqi$ flutter run Xcode build done. 4.5s Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/mdtaqi/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:69:53: error: incompatible block pointer types
sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'FIRAuthDataResultCallback _Nullable' (aka 'void (^)(FIRAuthDataResult * _Nullable __strong,
NSError * _Nullable __strong)')
[[FIRAuth auth] signInAnonymouslyWithCompletion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Headers/Public/Firebase/Firebase.h:18:
/Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/FirebaseAuth/Firebase/Auth/Source/Public/FIRAuth.h:575:77: note: passing argument to parameter
'completion' here
- (void)signInAnonymouslyWithCompletion:(nullable FIRAuthDataResultCallback)completion;
^
/Users/mdtaqi/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:77:21: warning: 'signInWithCredential:completion:'
is deprecated: Please use signInAndRetrieveDataWithCredential:completion: for Objective-C or signInAndRetrieveData(with:completion:) for Swift instead.
[-Wdeprecated-declarations]
[[FIRAuth auth] signInWithCredential:credential
^
In module 'FirebaseAuth' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Headers/Public/Firebase/Firebase.h:18:
/Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/FirebaseAuth/Firebase/Auth/Source/Public/FIRAuth.h:464:73: note: 'signInWithCredential:completion:' has
been explicitly marked deprecated here
completion:(nullable FIRAuthResultCallback)completion DEPRECATED_MSG_ATTRIBUTE(
^
In module 'UIKit' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Target Support Files/firebase_auth/firebase_auth-prefix.pch:2:
In module 'Foundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIK
it.h:8:
In module 'CoreFoundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Header
s/Foundation.h:6:
In module 'Darwin' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreFoundation.framework/He
aders/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/AvailabilityMacros.h:180:64: note:
expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
#define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
^
/Users/mdtaqi/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:84:21: warning: 'signInWithCredential:completion:'
is deprecated: Please use signInAndRetrieveDataWithCredential:completion: for Objective-C or signInAndRetrieveData(with:completion:) for Swift instead.
[-Wdeprecated-declarations]
[[FIRAuth auth] signInWithCredential:credential
^
In module 'FirebaseAuth' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Headers/Public/Firebase/Firebase.h:18:
/Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/FirebaseAuth/Firebase/Auth/Source/Public/FIRAuth.h:464:73: note: 'signInWithCredential:completion:' has
been explicitly marked deprecated here
completion:(nullable FIRAuthResultCallback)completion DEPRECATED_MSG_ATTRIBUTE(
^
In module 'UIKit' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Target Support Files/firebase_auth/firebase_auth-prefix.pch:2:
In module 'Foundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIK
it.h:8:
In module 'CoreFoundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Header
s/Foundation.h:6:
In module 'Darwin' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreFoundation.framework/He
aders/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/AvailabilityMacros.h:180:64: note:
expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
#define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
^
/Users/mdtaqi/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:93:21: warning: 'signInWithCredential:completion:'
is deprecated: Please use signInAndRetrieveDataWithCredential:completion: for Objective-C or signInAndRetrieveData(with:completion:) for Swift instead.
[-Wdeprecated-declarations]
[[FIRAuth auth] signInWithCredential:credential
^
In module 'FirebaseAuth' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Headers/Public/Firebase/Firebase.h:18:
/Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/FirebaseAuth/Firebase/Auth/Source/Public/FIRAuth.h:464:73: note: 'signInWithCredential:completion:' has
been explicitly marked deprecated here
completion:(nullable FIRAuthResultCallback)completion DEPRECATED_MSG_ATTRIBUTE(
^
In module 'UIKit' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Target Support Files/firebase_auth/firebase_auth-prefix.pch:2:
In module 'Foundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIK
it.h:8:
In module 'CoreFoundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Header
s/Foundation.h:6:
In module 'Darwin' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreFoundation.framework/He
aders/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/AvailabilityMacros.h:180:64: note:
expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
#define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
^
/Users/mdtaqi/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:102:41: error: incompatible block pointer types
sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'FIRAuthDataResultCallback _Nullable' (aka 'void (^)(FIRAuthDataResult * _Nullable __strong,
NSError * _Nullable __strong)')
completion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Headers/Public/Firebase/Firebase.h:18:
/Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/FirebaseAuth/Firebase/Auth/Source/Public/FIRAuth.h:648:65: note: passing argument to parameter
'completion' here
completion:(nullable FIRAuthDataResultCallback)completion;
^
/Users/mdtaqi/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:130:37: error: incompatible block pointer types
sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'FIRAuthDataResultCallback _Nullable' (aka 'void (^)(FIRAuthDataResult * _Nullable __strong,
NSError * _Nullable __strong)')
completion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Headers/Public/Firebase/Firebase.h:18:
/Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/FirebaseAuth/Firebase/Auth/Source/Public/FIRAuth.h:381:61: note: passing argument to parameter
'completion' here
completion:(nullable FIRAuthDataResultCallback)completion;
^
/Users/mdtaqi/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:153:33: warning: 'linkWithCredential:completion:'
is deprecated: Please use linkAndRetrieveDataWithCredential:completion: for Objective-C or linkAndRetrieveData(WithCredential:completion:) for Swift instead.
[-Wdeprecated-declarations]
[[FIRAuth auth].currentUser linkWithCredential:credential
^
In module 'FirebaseAuth' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Headers/Public/Firebase/Firebase.h:18:
/Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/FirebaseAuth/Firebase/Auth/Source/Public/FIRUser.h:334:71: note: 'linkWithCredential:completion:' has
been explicitly marked deprecated here
completion:(nullable FIRAuthResultCallback)completion DEPRECATED_MSG_ATTRIBUTE(
^
In module 'UIKit' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Target Support Files/firebase_auth/firebase_auth-prefix.pch:2:
In module 'Foundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIK
it.h:8:
In module 'CoreFoundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Header
s/Foundation.h:6:
In module 'Darwin' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreFoundation.framework/He
aders/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/AvailabilityMacros.h:180:64: note:
expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
#define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
^
/Users/mdtaqi/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:162:33: warning: 'linkWithCredential:completion:'
is deprecated: Please use linkAndRetrieveDataWithCredential:completion: for Objective-C or linkAndRetrieveData(WithCredential:completion:) for Swift instead.
[-Wdeprecated-declarations]
[[FIRAuth auth].currentUser linkWithCredential:credential
^
In module 'FirebaseAuth' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Headers/Public/Firebase/Firebase.h:18:
/Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/FirebaseAuth/Firebase/Auth/Source/Public/FIRUser.h:334:71: note: 'linkWithCredential:completion:' has
been explicitly marked deprecated here
completion:(nullable FIRAuthResultCallback)completion DEPRECATED_MSG_ATTRIBUTE(
^
In module 'UIKit' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Target Support Files/firebase_auth/firebase_auth-prefix.pch:2:
In module 'Foundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIK
it.h:8:
In module 'CoreFoundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Header
s/Foundation.h:6:
In module 'Darwin' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreFoundation.framework/He
aders/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/AvailabilityMacros.h:180:64: note:
expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
#define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
^
/Users/mdtaqi/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:169:33: warning: 'linkWithCredential:completion:'
is deprecated: Please use linkAndRetrieveDataWithCredential:completion: for Objective-C or linkAndRetrieveData(WithCredential:completion:) for Swift instead.
[-Wdeprecated-declarations]
[[FIRAuth auth].currentUser linkWithCredential:credential
^
In module 'FirebaseAuth' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Headers/Public/Firebase/Firebase.h:18:
/Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/FirebaseAuth/Firebase/Auth/Source/Public/FIRUser.h:334:71: note: 'linkWithCredential:completion:' has
been explicitly marked deprecated here
completion:(nullable FIRAuthResultCallback)completion DEPRECATED_MSG_ATTRIBUTE(
^
In module 'UIKit' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Target Support Files/firebase_auth/firebase_auth-prefix.pch:2:
In module 'Foundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIK
it.h:8:
In module 'CoreFoundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Header
s/Foundation.h:6:
In module 'Darwin' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreFoundation.framework/He
aders/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/AvailabilityMacros.h:180:64: note:
expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
#define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
^
/Users/mdtaqi/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:187:43: error: incompatible block pointer types
sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'FIRAuthDataResultCallback _Nullable' (aka 'void (^)(FIRAuthDataResult * _Nullable __strong,
NSError * _Nullable __strong)')
completion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from /Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/Headers/Public/Firebase/Firebase.h:18:
/Users/mdtaqi/Downloads/analise project list/analise_test/ios/Pods/FirebaseAuth/Firebase/Auth/Source/Public/FIRAuth.h:607:67: note: passing argument to parameter
'completion' here
completion:(nullable FIRAuthDataResultCallback)completion;
^
6 warnings and 4 errors generated.
Could not build the application for the simulator.
Error launching application on iPhone 6s.
Pubspec.yaml
name: analise_test
description: A new Flutter project.
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.0
# location_picker:
font_awesome_flutter:
timeago:
firebase_core: ^0.2.5+1
firebase_auth: 0.5.9
intl: 0.15.7
cloud_firestore: 0.7.0
firebase_database: 1.0.5
dev_dependencies:
flutter_test:
sdk: 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 Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/login-screen-background.png
- assets/signup-screen-background.png
- assets/starrbucks.png
- assets/mcdonalds.png
POD文件
# 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'
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 Pods/.symlinks')
system('mkdir -p Pods/.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('Pods', '.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('Pods', '.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
Flutter Doctor
[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14.3 18D109, locale en-IN)
• Flutter version 1.2.1 at /Users/mdtaqi/Downloads/flutter
• Framework revision 8661d8aecd (6 weeks ago), 2019-02-14 19:19:53 -0800
• Engine revision 3757390fa4
• Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/mdtaqi/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /Users/mdtaqi/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2, Build version 10E125
• ios-deploy 1.9.4
• CocoaPods version 1.5.0
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 33.4.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.3.5)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 33.4.2
• Dart plugin version 183.5912.23
[✓] VS Code (version 1.31.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.24.0
[✓] Connected device (1 available)
• iPhone 6s • 649A0E13-9AA1-4F2B-9458-99DD1FC2CD19 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)
• No issues found!
Process finished with exit code 0