skip to Main Content

I was working on a small flutter project suddenly I couldn’t run the app to any android mobile.
(on Web it’s running Perfectly).
It Shows this Error:

    Could not locate aapt. Please ensure you have the Android buildtools installed.
No application found for TargetPlatform.android_x86.
Is your project missing an androidappsrcmainAndroidManifest.xml?
Consider running "flutter create ." to create one.

How can I solve this Error
Thanks A Lot

This is my Gradle.build file:

buildscript {
    ext.kotlin_version = '1.5.21'
    repositories {
        google()
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }

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

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

2

Answers


  1. Chosen as BEST ANSWER

    I had the issue Android SDK file not found: C:UsersAdminAppDataLocalAndroidSdkbuild-tools31.0.0aapt.

    I had already tried other solutions but this worked for me . In SDK Manager , go to SDK tools , and check the checkbox "Show the various packages" and uncheck "Hide obsolete packages"

    Now under Android SDK Build-tools 31 , install 31.0.0 and apply Under Android SDK Command-line tools (latest), install Android SDK Command-line tools (obsolete)

    This worked for me!


  2. maybe

    flutter doctor -v
    

    usefull

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search