gpt4 book ai didi

火力地堡, flutter 错误 'Could not resolve all files for configuration'

转载 作者:行者123 更新时间:2023-12-05 06:56:26 32 4
gpt4 key购买 nike

今天我在学习 firebase,但在运行该应用程序时卡住了。

以下是我在更改后构建应用程序时遇到的错误-:

Launching lib\main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':firebase_core:javaPreCompileDebug'.
> Could not resolve all files for configuration ':firebase_core:debugCompileClasspath'.
> Could not find auto-value-annotations.jar (com.google.auto.value:auto-value-annotations:1.6.5).
Searched in the following locations:
https://jcenter.bintray.com/com/google/auto/value/auto-value-annotations/1.6.5/auto-value-annotations-1.6.5.jar

* 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
Exception: Gradle task assembleDebug failed with exit code 1

下面是我进行更改的文件,我认为我是正确的,因为我是 firebase 和 flutter 的新手 -: App\build.gradle

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 29

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.flashchat"
minSdkVersion 16
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}

flutter {
source '../..'
}



dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

下面是android\build.gradle文件

buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.3.4'
}
}

allprojects {
repositories {
google()
jcenter()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
delete rootProject.buildDir
}

请帮我解决这个...

下面是pubspec.yaml文件


name: flashchat
description: A new Flutter application.

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
sdk: ">=2.7.0 <3.0.0"

dependencies:
flutter:
sdk: flutter


cupertino_icons: ^1.0.1
firebase_core: ^0.5.3
firebase_auth: ^0.18.4
cloud_firestore: ^0.14.4
animated_text_kit: ^2.5.4

dev_dependencies:
flutter_test:
sdk: flutter

flutter:

uses-material-design: true

# To add assets to your application, add an assets section, like this:
assets:
- images/flash.png
- images/flash1.png

最佳答案

尝试添加这个

 defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.game_app"
minSdkVersion 21
targetSdkVersion 30
multiDexEnabled true - !!!add this line
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

同时添加 multiDexEnabled 实现

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:27.1.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.android.support:multidex:1.0.3' // add this line
}

关于火力地堡, flutter 错误 'Could not resolve all files for configuration',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65140200/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com