配置根项目时出现问题 'firebase_auth'
A problem occurred configuring root project 'firebase_auth'
我的错误
我无法构建 apk 发布文件,我完成了一段时间没有错误的应用程序,几天后我在构建应用程序时收到此错误,请告诉我如何摆脱它,我尝试了 4 个小时,一无所获。
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':moneytextformfield:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\HaAnh\.gradle\caches\transforms-2\files-2.1\d184951b898fabeaa0294fd3e5d63233\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\HaAnh\.gradle\caches\transforms-2\files-2.1\d184951b898fabeaa0294fd3e5d63233\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.
* 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
Running Gradle task 'assembleRelease'... 26.3s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin firebase_auth...
Running Gradle task 'assembleAarRelease'... 3.0s
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'firebase_auth'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* 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 2s
The plugin firebase_auth could not be built due to the issue above.
这是我的pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.2.2 <3.0.0"
dependencies:
floating_action_bubble: ^1.1.0
expansion_card: ^0.1.0
introduction_screen: ^1.0.8
#cloud_firestore: ^0.13.4
firebase_auth: ^0.15.3
google_sign_in: ^4.0.4
#apple_sign_in: ^0.1.0
firebase_database: ^3.1.5
firebase_core: ^0.4.4+3
carousel_pro: ^1.0.0
carousel_slider: ^1.4.1
flutter_auth_buttons: ^0.6.0
community_material_icon: ^3.5.95
image_picker: ^0.6.3+4
image_cropper: ^1.2.1
curved_navigation_bar: ^0.3.2
dio: ^3.0.9
giffy_dialog: ^1.7.0
#firebase_storage: ^3.0.6
#firebase_messaging: 6.0.13
#flutter_local_notifications: 1.4.0
#cloud_firestore: ^0.12.9+5
cached_network_image: 2.0.0-rc.1
shimmer: ^1.1.1
intl: ^0.15.7
flutter_countdown_timer: ^1.0.0
moneytextformfield: ^0.3.5+1
flutter_money_formatter: ^0.8.3
time_formatter: ^1.0.0+5
#firebase_auth: ^0.11+1+10
#cloud_firestore: ^0.13.4+2
#google_sign_in: ^4.4.1
mime: ^0.9.6+3
http_parser: ^3.1.4
flutter_spinkit: ^3.1.0
numeric_keyboard: ^1.0.0
beauty_textfield: ^0.0.1
# ^3.2.4
shared_preferences: any
fluttertoast: ^3.1.3
http: any
auto_size_text: ^2.1.0
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
我想在不影响内部代码的情况下解决这个问题我害怕出错,因为我 运行 超出了处理时间。
感谢您的光临,尽管只有一缕阳光,但我希望能听到您的消息。
-- 更新
在我做了“flutter运行”之后,又出现了这个错误
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Do not run this command from the root of your git clone of Flutter.
这看起来像是 android 配置 问题。
解决方案是将 依赖项 添加到您的 android 项目。
第一步是按照 Firebase Auth pub.dev page
上的说明进行操作
您可以通过将以下行添加到您的 android/build.gradle
文件来完成此操作:
dependencies {
// Example existing classpath
classpath 'com.android.tools.build:gradle:3.2.1'
// Add the google services classpath
classpath 'com.google.gms:google-services:4.3.0'
}
并将以下行添加到 android/app/build.gradle
文件的底部
apply plugin: 'com.google.gms.google-services'
接下来要做的是将 Firebase Auth 插件添加到您的 android 实现中
要做到这一点,您应该按照说明进行操作 here
我的错误
我无法构建 apk 发布文件,我完成了一段时间没有错误的应用程序,几天后我在构建应用程序时收到此错误,请告诉我如何摆脱它,我尝试了 4 个小时,一无所获。
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':moneytextformfield:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\HaAnh\.gradle\caches\transforms-2\files-2.1\d184951b898fabeaa0294fd3e5d63233\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\HaAnh\.gradle\caches\transforms-2\files-2.1\d184951b898fabeaa0294fd3e5d63233\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.
* 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
Running Gradle task 'assembleRelease'... 26.3s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin firebase_auth...
Running Gradle task 'assembleAarRelease'... 3.0s
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'firebase_auth'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* 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 2s
The plugin firebase_auth could not be built due to the issue above.
这是我的pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.2.2 <3.0.0"
dependencies:
floating_action_bubble: ^1.1.0
expansion_card: ^0.1.0
introduction_screen: ^1.0.8
#cloud_firestore: ^0.13.4
firebase_auth: ^0.15.3
google_sign_in: ^4.0.4
#apple_sign_in: ^0.1.0
firebase_database: ^3.1.5
firebase_core: ^0.4.4+3
carousel_pro: ^1.0.0
carousel_slider: ^1.4.1
flutter_auth_buttons: ^0.6.0
community_material_icon: ^3.5.95
image_picker: ^0.6.3+4
image_cropper: ^1.2.1
curved_navigation_bar: ^0.3.2
dio: ^3.0.9
giffy_dialog: ^1.7.0
#firebase_storage: ^3.0.6
#firebase_messaging: 6.0.13
#flutter_local_notifications: 1.4.0
#cloud_firestore: ^0.12.9+5
cached_network_image: 2.0.0-rc.1
shimmer: ^1.1.1
intl: ^0.15.7
flutter_countdown_timer: ^1.0.0
moneytextformfield: ^0.3.5+1
flutter_money_formatter: ^0.8.3
time_formatter: ^1.0.0+5
#firebase_auth: ^0.11+1+10
#cloud_firestore: ^0.13.4+2
#google_sign_in: ^4.4.1
mime: ^0.9.6+3
http_parser: ^3.1.4
flutter_spinkit: ^3.1.0
numeric_keyboard: ^1.0.0
beauty_textfield: ^0.0.1
# ^3.2.4
shared_preferences: any
fluttertoast: ^3.1.3
http: any
auto_size_text: ^2.1.0
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
我想在不影响内部代码的情况下解决这个问题我害怕出错,因为我 运行 超出了处理时间。 感谢您的光临,尽管只有一缕阳光,但我希望能听到您的消息。
-- 更新 在我做了“flutter运行”之后,又出现了这个错误
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Do not run this command from the root of your git clone of Flutter.
这看起来像是 android 配置 问题。
解决方案是将 依赖项 添加到您的 android 项目。
第一步是按照 Firebase Auth pub.dev page
上的说明进行操作您可以通过将以下行添加到您的 android/build.gradle
文件来完成此操作:
dependencies {
// Example existing classpath
classpath 'com.android.tools.build:gradle:3.2.1'
// Add the google services classpath
classpath 'com.google.gms:google-services:4.3.0'
}
并将以下行添加到 android/app/build.gradle
文件的底部
apply plugin: 'com.google.gms.google-services'
接下来要做的是将 Firebase Auth 插件添加到您的 android 实现中
要做到这一点,您应该按照说明进行操作 here