最近我在我的顫振專案中添加了 firebase。為了使用 firebase 資料庫服務,我添加了 cloud_firebase 包。但是在添加這個包后,我的應用程式沒有運行并給我一個例外:
BUILD FAILED in 31s
The plugin cloud_firestore requires a higher Android SDK version.
Fix this issue by adding the following to the file C:\Users\Jaguar\Desktop\AppDevelopment\acadmt\android\app\build.gradle:
android {
defaultConfig {
minSdkVersion 19
}
}
Note that your app won't be available to users running Android SDKs below 19.
Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.
Exception: Gradle task assembleDebug failed with exit code 1
例外訊息還提出以下建議:
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="io.flutter.plugins.firebase.firestore" to force usage (may lead to runtime failures)
我已經嘗試了前兩個建議,但該應用程式仍然無法正常作業。
uj5u.com熱心網友回復:
走這條路:
C:\Users\Jaguar\Desktop\AppDevelopment\acadmt\android\app\build.gradle
android {
defaultConfig {
minSdkVersion 19
}
}
將您的 minSdkVersion 更改為 30
那是:
android {
defaultConfig {
minSdkVersion 30
}
}
uj5u.com熱心網友回復:
編輯 minSdkVersion 后,您可能無法應用更改
解決這個問題:
1-打開 build.gradle 檔案并編輯它:
android {
defaultConfig {
minSdkVersion 19
}
}
然后在android studio的右側,確保在android studio中選擇打開進行編輯以應用更改并同步gradle以進行新更改。
2-清理(檔案>無效快取/重新啟動)
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/367798.html
