我正在用顫振做一個聊天應用程式。我只是在開始嘗試使用 Flutter 設定 Firebase。
當我添加到我的pubspec.yaml 時:(從 pub.dev 復制)
firebase_auth: ^3.3.10
firebase_core: ^1.13.1
我得到了我的 Android 和 iOS 模擬器錯誤。對于安卓我有:
/Users/puskasimolaflora/AndroidStudioProjects/bsc/android/app/src/debug/AndroidManifest.xml Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [com.google.firebase:firebase-analytics-ktx:20.1.0] /Users/puskasimolaflora/.gradle/caches/transforms-2/files-2.1/a328238d31bf521a00741e1d4b91c005/jetified-firebase-analytics-ktx-20.1.0/AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 19,
or use tools:overrideLibrary="com.google.firebase.analytics.ktx" to force usage (may lead to runtime failures)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [com.google.firebase:firebase-analytics-ktx:20.1.0] /Users/puskasimolaflora/.gradle/caches/transforms-2/files-2.1/a328238d31bf521a00741e1d4b91c005/jetified-firebase-analytics-ktx-20.1.0/AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 19,
or use tools:overrideLibrary="com.google.firebase.analytics.ktx" to force usage (may lead to runtime failures)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 25s
Exception: Gradle task assembleDebug failed with exit code 1
對于 iOS,我得到:
CocoaPods could not find compatible versions for pod "firebase_auth":
In Podfile:
firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
Specs satisfying the `firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)` dependency were found, but they required a higher minimum deployment target.
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
<internal:kernel>:90:in `tap'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:682:in `attempt_to_activate'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:94:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in `install!'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/bin/pod:25: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
Error launching application on iPhone 11 Pro Max.
我已經嘗試了我在這些主題上找到的所有解決方案,但它仍然沒有運行。
uj5u.com熱心網友回復:
安卓版
uses-sdk:minSdkVersion 16 不能是... minSdk 版本至少為 19,
在你的 build.gradle 更新你的 minsdk 版本到至少 19
這是假設您添加了 firebase android 依賴項。
在 build.gradle
//if you are using crashlytics
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
//if you are using pref
classpath 'com.google.firebase:perf-plugin:1.4.0'
classpath 'com.google.gms:google-services:4.3.10'
在 app/build.gradle
dependencies {
...
implementation platform('com.google.firebase:firebase-bom:29.0.4')
// Add the dependency for the Firebase SDK for Google Analytics
// When using the BoM, don't specify versions in Firebase dependencies
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-perf'
}
應用插件
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.firebase.firebase-perf'
IOS _
在您的 Podfile 中將平臺版本從 9 更改為更高的值,例如 platform :ios, '12.0',如果已評論,請不要忘記取消評論。
如果您的構建時間很長,請嘗試通過將其添加到您的 podfile 來使用預構建的 firestore 二進制檔案
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.11.0'
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/440736.html
標籤:火力基地 扑 安卓工作室 firebase 身份验证 颤振依赖
上一篇:如何洗掉我在螢屏截圖中標記的內容
