1

Hi i don`t know what to do with this problem every time when i want to run my project

this Error:

Launching lib\main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
Could not write file to C:\Users\elkha\OneDrive\Документы\crypto_list2\build\app\intermediates\flutter\debug\flutter_assets\shaders/ink_sparkle.frag.spirv

Target debug_android_application failed: ShaderCompilerException: Shader compilation of "C:\Users\elkha\flutter\packages\flutter\lib\src\material\shaders\ink_sparkle.frag" to "C:\Users\elkha\OneDrive\Документы\crypto_list2\build\app\intermediates\flutter\debug\flutter_assets\shaders/ink_sparkle.frag" failed with exit code 1.
impellerc stdout:

impellerc stderr:
Could not write file to C:\Users\elkha\OneDrive\Документы\crypto_list2\build\app\intermediates\flutter\debug\flutter_assets\shaders/ink_sparkle.frag.spirv
FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\elkha\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1151

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\elkha\flutter\bin\flutter.bat'' finished with non-zero exit value 1

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

My 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 FileNotFoundException("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: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    kotlinOptions {
        jvmTarget = '11'
    }

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

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.elcode.crypto_list2"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    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"
}

My build.gradle2:

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

    dependencies {
        classpath 'com.android.tools.build:gradle:7.2.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

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
}

settings.gradle:

include ':app'

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"

gradle.properties:

org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.overridePathCheck=true

I run it in Andtoid Studio but in VS it gives me this two error it says that i need to update my jdk in gradle from 1.8 to 11 i search solution for this problem but i don`t found anything , i try to channge it in android studio Project Settings but in gradle settings there is not Gradle project stettings to change jdk, i try to change from build.gradle but it is not work.In stackoverflow i found one solution it say that i need to change my gradle version to older but it not work too.I use emulator and when i run it on chrome it works.Please help.

  • https://stackoverflow.com/questions/61930007/how-to-solve-execution-failed-for-task-appcompileflutterbuilddebug. Please follow this link – Uvais Jan 28 '23 at 15:25

1 Answers1

1

Faced same exact error impellerc stdout:... when building my sample flutter on my mac laptop.

I was able to resolve this error using the following steps below :

  1. On your Mac, choose Apple menu > System Settings.

  2. Scroll and click Privacy & security, then scroll down to security section.

  3. Click the lock icon to unlock it, then enter an administrator name and password. Select the sources from which you’ll allow software to be installed: There should be a button that says "Allow anyway" which when clicked will prompt for administrator name and password. If not make sure you've cancelled the error dialog.

impellerc

Dev Environment:

------------------------------------------------------------
Flutter       3.7.1
Gradle        7.6
Kotlin:       1.7.10
Groovy:       3.0.13
JVM:          17.0.6 (Homebrew 17.0.6+0)
OS:           Mac OS X 13.0 aarch64
aksyuma
  • 2,957
  • 1
  • 15
  • 29