Конкретная ошибка, которую я получаю:
Код: Выделить всё
Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain
Caused by: java.lang.ClassNotFoundException: worker.org.gradle.process.internal.worker.GradleWorkerMain
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':gradle:compileGroovy'.
> Failed to run Gradle Worker Daemon
> Process 'Gradle Worker Daemon 4' finished with non-zero exit value 1
Очистил кеши Gradle несколько раз с помощью rm -rf ~/.gradle/caches/< /code>
Пересобрал оболочку Gradle с помощью оболочки ./gradlew --gradle-version 8.3 --distribution-type all.
Установить версию Java 17 (так как этого требуют плагин Firebase и Android Gradle).
Гарантировано, что версия com.android.tools.build:gradle совместима с Gradle 8.x.
Удалены папки .gradle и .idea, чтобы избежать потенциальных проблем с кешем IDE.
Попытался собрать проект через Android Studio и использовать командную строку. ./gradlew clean последовало от ./gradlew assembleDebug.
Я использую Gradle 8.3 и Java 17, и проблема не устранена.
После этих шагов я все еще столкнулся с той же проблемой. Эта ошибка появилась после попытки добавить Firebase в проект, и я подозреваю, что установка Firebase могла вызвать конфликт с моей настройкой Gradle.
Ниже приведен мой файл settings.gradle :
Код: Выделить всё
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.1.0" apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
// END: FlutterFire Configuration
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}
include ":app"
Код: Выделить всё
plugins {
id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
// END: FlutterFire Configuration
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}
android {
namespace = "com.example.ticketmasterapp"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.ticketmasterapp"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}
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 = "../.."
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... ernal-work
Мобильная версия