2
votes

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'
}
1
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. - iRuth
I updated the quesion with what app/build.gradle says in line 24 - Olaitan
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.... - iRuth

1 Answers

3
votes

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...