Error: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. when trying to launch app

Error: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. when trying to launch app

在将 flutter 升级到最新版本 2.5.0 以及我的所有软件包和 gradle 到更新版本

后发生错误

完整错误信息:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to find Build Tools revision 29.0.2

* 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

gradle 应用级别的依赖项:

implementation 'com.android.support:multidex:2.0.1'
    implementation 'com.google.firebase:firebase-analytics'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.browser:browser:1.3.0'

gradle 项目级别的依赖项:

classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.0'

我还确保我的模拟器已连接到互联网并且我已接受 android sdk 许可证

原来这个错误是因为我的 java 版本 jdk 太旧了,通过升级到 Java 13

解决了这个问题