2

i'm using windows 10 Visual Studio Code and i'm trying to run my code after writing them and this is what it shows me afterwards.

Launching lib\main.dart on TECNO Camon CX in debug mode... * Error running Gradle: ProcessException: Process "C:\Users\IB\Desktop\Android\myapp\berry_networks\Dart test\Flutter App\first_flutter_app\android\gradlew.bat" exited abnormally:

FAILURE: Build failed with an exception.

  • Where: Build file 'C:\Users\IB\Desktop\Android\myapp\berry_networks\Dart test\Flutter App\first_flutter_app\android\app\build.gradle' line: 24

  • What went wrong: A problem occurred evaluating project ':app'.

    Failed to apply plugin [id 'com.android.application'] Illegal char <<> at index 9: C:/users//.android\analytics.settings

  • 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 7s Command: C:\Users\IB\Desktop\Android\myapp\berry_networks\Dart test\Flutter App\first_flutter_app\android\gradlew.bat app:properties

Please review your Gradle project setup in the android/ folder. Exited (sigterm)

how do i fix this?

@iRuth

This is my app/build.gradle on Visual Studio Code

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'   (This is line 24)
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.kkkkkkkk"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "android.support.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 {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
3
  • Have you tried opening the android folder separately in Visual Studio code or Android Studio? What's the content of your app/build.gradle file? It's complaining about line 24. Commented May 11, 2019 at 20:09
  • I updated the quesion with what app/build.gradle says in line 24 Commented May 13, 2019 at 16:17
  • This may be an AndroidX issue. Can you try upgrading the project to AndroidX? You can do that when you open the android folder of your project in Android Studio. In the Refactor menu, select Migrate to AndroidX.... Commented May 18, 2019 at 20:10

2 Answers 2

4

After many researches on how to fix my debugging issue with visual studio code proves abortive then i tried switching to android studio and downgrading my windows 10 to 8, but still that didn't solve it, it worsen the case.

I tried to have deep sleep and do nothing about it just to have some days off, i watch movies and making little researches.

eventually after boxing my head and loosing the tightened knot, i upgrade my system back to windows 10 and install everything one after the other: Step 1: i install ADB Step 2: i install Android Studio code Step 3: i install Dart and Flutter Step 4: i install SDK for android studio and set the environmental variables Step 5: i install SDK platform tools and as well as setting the path in environmental variables. Step 6: i install JDK for android studio and set the environmental variables as well

It wasn't easy for me as a beginner because i spent almost 2 month fixing this and i eventually find the answer through self taught and self motivation.

I want to thank everyone that contributed to the cause which i laid down here.

@IRuth i really appreciate your effort...

Sign up to request clarification or add additional context in comments.

Comments

0

to fix all of gradle errors on vscode you need to update your gradle to last version for this first go to

android > app > src > main > click on java folder and then click on plugins then debug the plugins with F5

or install this extension https://marketplace.visualstudio.com/items?itemName=redhat.java

so after this vscode ask you to update plugins click on update and wait till it end to update your gradle project and java project so after this

flutter clean

and debuge your project it will install your build again with last version

hope this helpfull.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.