i am jumping between gradle files,vscode settings,android studio and path variables but to no avail it doesn’t work i am working on a flutter app with firebase PS C:Users*Downloadsa**> flutter run
Launching libmain.dart on sdk gphone64 x86 64 in debug mode…
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:sign_in_with_apple:compileDebugKotlin’.
‘compileDebugJavaWithJavac’ task (current target is 1.8) and ‘compileDebugKotlin’ task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain
changing settings.json
{
"git.autofetch": true,
"diffEditor.ignoreTrimWhitespace": false,
"explorer.confirmDelete": false,
"typescript.updateImportsOnFileMove.enabled": "never",
"workbench.iconTheme": "material-icon-theme",
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
80
],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": "off"
},
"dart.addSdkToTerminalPath": true,
"dart.sdkPaths": [
"C:\Users\Salil\Downloads\YoutubeClone-Flutter-master\youtubeclone_env\Scripts\flutter"
],
"dart.sdkPath": null,
"githubPullRequests.pullBranch": "never",
"workbench.startupEditor": "none",
"liveServer.settings.donotShowInfoMsg": true,
"editor.inlineSuggest.enabled": true,
"github.copilot.enable": {
"*": true,
"plaintext": true,
"markdown": false,
"scminput": false,
"cpp": true
},
"vs-kubernetes": {
"vscode-kubernetes.helm-path.windows": "C:\Users\Salil\.vs-kubernetes\tools\helm\windows-amd64\helm.exe",
"vscode-kubernetes.kubectl-path.windows": "C:\Users\Salil\.vs-kubernetes\tools\kubectl\kubectl.exe",
"vscode-kubernetes.minikube-path.windows": "C:\Users\Salil\.vs-kubernetes\tools\minikube\windows-amd64\minikube.exe"
},
"C_Cpp.default.includePath": [
"C:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\include\QtGui"
],
"cmake.additionalCompilerSearchDirs": [
"C:/msys64/mingw32/bin",
"C:/msys64/clang32/bin",
"C:/msys64/clang64/bin",
"C:/msys64/clangarm64/bin",
"C:/msys64/ucrt64/bin"
],
"git.enableSmartCommit": true,
"git.confirmSync": false,
"dart.flutterSdkPaths": [
"C:\Users\Salil\Downloads\YoutubeClone-Flutter-master\youtubeclone_env\Scripts\flutter\bin"
],
"github.copilot.editor.enableAutoCompletions": true,
"java.debug.settings.vmArgs": "-Xmx4G -ea",
"java.jdt.ls.vmargs": "",
"settingsSync.ignoredSettings": [
"-dart.sdkPath",
"-dart.flutterSdkPath",
"-java.configuration.runtimes",
"-java.import.gradle.java.home",
"-java.import.gradle.user.home",
"-java.import.gradle.home",
"-maven.executable.path",
"-java.jdt.ls.java.home"
],
"liveServer.settings.donotVerifyTags": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"debug.javascript.debugByLinkOptions": "on",
"[gradle]": {},
"github.copilot.preferredAccount": "SalilHarit",
"workbench.settings.applyToAllProfiles": [
"java.import.gradle.java.home"
],
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.linkedEditing": true,
"editor.minimap.enabled": false,
"editor.rulers": [
{
"column": 80,
"color": "#00FF0010"
},
{
"column": 100,
"color": "#BDB76B15"
},
{
"column": 120,
"color": "#FA807219"
}
],
"editor.unicodeHighlight.includeComments": true,
"workbench.colorCustomizations": {
"[Default Dark Modern]": {
"tab.activeBorderTop": "#00FF00",
"tab.unfocusedActiveBorderTop": "#00FF0088",
"textCodeBlock.background": "#00000055"
},
"editor.wordHighlightStrongBorder": "#FF6347",
"editor.wordHighlightBorder": "#FFD700",
"editor.selectionHighlightBorder": "#A9A9A9"
},
"workbench.editor.revealIfOpen": true,
"workbench.tree.indent": 20,
"files.eol": "n",
"[bat]": {
"files.eol": "rn"
},
"emmet.variables": {
"lang": "en"
},
"cSpell.diagnosticLevel": "Hint",
"trailing-spaces.backgroundColor": "rgba(255,0,0,0.1)",
"trailing-spaces.includeEmptyLines": false,
"terminal.integrated.tabs.hideCondition": "never",
"terminal.integrated.enablePersistentSessions": false,
"java.configuration.detectJdksAtStart": false,
"java.configuration.updateBuildConfiguration": "automatic",
"java.debug.settings.hotCodeReplace": "auto",
"java.dependency.packagePresentation": "hierarchical",
"java.sources.organizeImports.staticStarThreshold": 1,
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot",
"default": true
},
{
"name": "JavaSE-1.8",
"path": "C:\Program Files\Eclipse Adoptium\jdk-8.0.422.5-hotspot",
},
{
"name": "JavaSE-22",
"path": "C:\Program Files\Java\jdk-22",
}
],
"terminal.integrated.profiles.windows": {
"JavaSE-17": {
"overrideName": true,
"env": {
"PATH": "C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot\bin;${env:PATH}",
"JAVA_HOME": "C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot"
},
"path": "cmd"
},
},
"terminal.integrated.automationProfile.windows": {
"path": "cmd"
},
"java.test.config": {
"vmArgs": [
"-Dstdout.encoding=UTF-8",
"-Dstderr.encoding=UTF-8"
]
},
"terminal.integrated.env.windows": {
"JAVA_HOME": "C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot",
"PATH": "C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot\bin;${env:PATH}"
},
"maven.terminal.customEnv": [
{
"environmentVariable": "JAVA_HOME",
"value": "C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot"
}
],
"terminal.integrated.defaultProfile.windows": "PowerShell",
"java.project.outputPath": "",
"java.imports.gradle.wrapper.checksums": [],
"files.associations": {
"*.gradle": "dart"
},
"java.maven.downloadSources": true,
"java.import.gradle.version": "",
"[java-properties]": {},
"java.jdt.ls.java.home": "C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot\bin",
}
and app/build.gradle
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.gms.google-services" // Google Services plugin
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1.0'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 34
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.mycompany.astrovista"
minSdkVersion 21
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
versionCode 167
}
signingConfigs {
release {
keyAlias '**'
keyPassword ''
storeFile file('')
storePassword ''
}
}
buildTypes {
release {
shrinkResources true
signingConfig signingConfigs.release
minifyEnabled true
ndk {
debugSymbolLevel = 'FULL'
}
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10"
}
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 "7.4.2" apply false
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
id "com.google.gms.google-services" version "4.4.2" apply false // Google Services plugin
}
include ":app"
android/build.gradle
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(":app")
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}