gpt4 book ai didi

android - 任务 ':app:transformClassesWithDexBuilderForDebug'的执行失败。 >无法在Android Studio中为文件创建MD5哈希(Flutter)

转载 作者:行者123 更新时间:2023-12-03 05:24:45 25 4
gpt4 key购买 nike

我正在使用最新版本的Android Studio,我在项目中添加了Firebase依赖项,也将其迁移到AndriodX,但仍然无法正常工作。
还尝试了使缓存无效/重新启动,但是它不起作用

这是运行我的项目后给出的错误

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
The system cannot find the path specified.
Parameter format not correct -

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> Failed to create MD5 hash for file 'C:\Users\RIDER\AndroidStudioProjects\flash_chatgradleissue\build\app\intermediates\transforms\dexBuilder\debug\0\com\google\firebase\database\collection\R.dex' as it does not exist.

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

我的pupspec.yml文件
description: A new Flutter application.

version: 1.0.0+1

environment:
sdk: ">=2.1.0<3.0.0"

dependencies:
flutter:
sdk: flutter

cupertino_icons: ^0.1.2
cloud_firestore: ^0.13.1
firebase_auth: ^0.16.0
firebase_core: ^0.4.4+3


dev_dependencies:
flutter_test:
sdk: flutter

flutter:
uses-material-design: true

assets:
- images/

我的app / build.gradle文件
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 FileNotFoundException("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"

allprojects {

gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
}
}

android {
compileSdkVersion 28

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "co.demon.flash_chat"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}

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 {
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.google.firebase:firebase-analytics:17.4.1'
implementation 'com.google.firebase:firebase-auth:19.3.1'
}
apply plugin: 'com.google.gms.google-services'

我的gradle / build.gradle文件
buildscript {
repositories {
google()
jcenter()
}

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

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
}

Flutter医生报告
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18363.836], locale en-IN)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[!] VS Code (version 1.44.2)
X Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (1 available)

! Doctor found issues in 1 category.

我是 flutter 开发的初学者,我在此问题中受了3天的困扰,尝试了很多事情,但是没有起作用。

最佳答案

检查您的系统中是否为Android Studio定义了Path,它可能会丢失。如果定义正确,请检查Android Studio文件夹的权限

关于android - 任务 ':app:transformClassesWithDexBuilderForDebug'的执行失败。 >无法在Android Studio中为文件创建MD5哈希(Flutter),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61818840/

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