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
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 toSDK tools
, and check the checkbox "Show the various packages" and uncheck "Hide obsolete packages"Now under
Android SDK Build-tools 31
, install31.0.0
and apply UnderAndroid SDK Command-line tools
(latest), installAndroid SDK Command-line tools
(obsolete)This worked for me!
maybe
usefull