无法计算任务的值:device_info:compiledebugjavawithjavac'属性; options.generatedSourceoutputdirectory'

发布于 2025-02-02 20:30:22 字数 2021 浏览 0 评论 0原文

今天,当我在Android Studio 2021.2.1中构建扑动(flutter版本:2.8.0)项目时,显示错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':device_info:compileDebugJavaWithJavac'.
> Failed to calculate the value of task ':device_info:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
   > Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, /Users/foo/source/reddwarf/frontend/cruise-open/build/device_info/generated/ap_generated_sources/debug/out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@265a97d4) before task ':device_info:compileDebugJavaWithJavac' has completed is not supported

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

为什么会发生这种情况?我该怎么办来解决这个问题?有人面临类似问题吗? pubspec.yaml版本的LIB设备信息是:device_info: ^2.0.0。这是我的build.gradle

buildscript {
    ext.kotlin_version = '1.6.20'
    repositories {
        google()
        mavenCentral()

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.5'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

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

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

Today when I build the flutter (flutter version:2.8.0) project in android studio 2021.2.1, shows error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':device_info:compileDebugJavaWithJavac'.
> Failed to calculate the value of task ':device_info:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
   > Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, /Users/foo/source/reddwarf/frontend/cruise-open/build/device_info/generated/ap_generated_sources/debug/out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@265a97d4) before task ':device_info:compileDebugJavaWithJavac' has completed is not supported

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

why did this happen? what should I do to fix this problem? Anyone facing the similiar issue? The lib device info in pubspec.yaml version is: device_info: ^2.0.0. This is my build.gradle:

buildscript {
    ext.kotlin_version = '1.6.20'
    repositories {
        google()
        mavenCentral()

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.5'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文