简体   繁体   English

无法确定任务“:app:compileDebugJavaWithJavac”的依赖关系。 - 颤振问题

[英]Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. - Flutter Issue

Trying to run the Flutter app and facing this issue.尝试运行 Flutter 应用程序并面临此问题。 Tried each and every solution out there but didn't succeed.尝试了每一个解决方案,但没有成功。 Below is the error what I am receiving while running the app.以下是我在运行应用程序时收到的错误。 Any help would be appreciated.任何帮助,将不胜感激。

Thanks!谢谢!

Running "flutter pub get" in sample_app...
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
   > Problems reading data from Binary store in /private/var/folders/lj/7jcbbmp507v0bxbdfnlh56_c0000gn/T/gradle6036859919611612075.bin offset 322825 exists? true

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

flutter doctor result:扑医生结果:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.7 19H2, locale en)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.50.1)
[✓] Connected device (1 available)

• No issues found!

app/build.gradle应用程序/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 plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.sample_app"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    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 "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:multidex:1.0.3'
    //implementation 'com.google.firebase:firebase-messaging:<latest_version>'
    //implementation 'com.google.firebase:firebase-analytics'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

android/build.gradle android/build.gradle

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

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
}

Trying to run the Flutter app and facing this issue.尝试运行Flutter应用程序并遇到此问题。 Tried each and every solution out there but didn't succeed.尝试了所有解决方案,但没有成功。 Below is the error what I am receiving while running the app.以下是我在运行该应用程序时收到的错误。 Any help would be appreciated.任何帮助,将不胜感激。

Thanks!谢谢!

Running "flutter pub get" in sample_app...
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
   > Problems reading data from Binary store in /private/var/folders/lj/7jcbbmp507v0bxbdfnlh56_c0000gn/T/gradle6036859919611612075.bin offset 322825 exists? true

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

flutter doctor result:扑医生结果:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.7 19H2, locale en)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.50.1)
[✓] Connected device (1 available)

• No issues found!

app/build.gradle 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 plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.sample_app"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    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 "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:multidex:1.0.3'
    //implementation 'com.google.firebase:firebase-messaging:<latest_version>'
    //implementation 'com.google.firebase:firebase-analytics'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

android/build.gradle android / build.gradle

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

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
}

I've had the very same problem.我遇到了同样的问题。 It just started without any reason or change in code.它只是在没有任何原因或代码更改的情况下开始。 Solved it by accident when I upgraded flutter and then got back to the previous flutter version:在我升级flutter然后回到之前的flutter版本时无意中解决了这个问题:

flutter upgrade    
flutter downgrade vX.X.X

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法确定任务 &#39;:app:compileDebugJavaWithJavac&#39; 的依赖关系。[Flutter] - Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.[Flutter] 无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系 - Flutter - Could not determine the dependencies of task ':app:compileDebugJavaWithJavac' - Flutter 无法确定任务 ':app:compileDebugJavaWithJavac' Flutter 的依赖关系 - Could not determine the dependencies of task ':app:compileDebugJavaWithJavac' Flutter Flutter 构建错误:无法确定任务':app:compileDebugJavaWithJavac的依赖关系 - Flutter Build Error:Could not determine the dependencies of task ':app:compileDebugJavaWithJavac flutter run 无法确定任务&#39;:app:compileDebugJavaWithJavac&#39;的依赖关系 - flutter run Could not determine the dependencies of task ':app:compileDebugJavaWithJavac' Flutter 通知 OneSignal - 无法确定任务 &#39;:app:compileDebugJavaWithJavac&#39; 的依赖关系 - Flutter Notification OneSignal - Could not determine the dependencies of task ':app:compileDebugJavaWithJavac' flutter 错误无法确定任务':app:compileDebugJavaWithJavac'的依赖关系 - flutter error Could not determine the dependencies of task ':app:compileDebugJavaWithJavac' 无法确定任务“:app:compileDebugJavaWithJavac”的依赖关系。 在科尔多瓦有问题 - Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. having issue's in Cordova 错误:无法确定任务&#39;:app:compileDebugJavaWithJavac&#39;的依赖关系 - Error:Could not determine the dependencies of task ':app:compileDebugJavaWithJavac' 无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。 (一个信号) - Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. (OneSignal)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM