I've installed the Flutter SDK and Android Studio, and I've set everything up. However, when I try to run the project, I'm facing this error.
Flutter Version: 3.27.1
Java Version: 17.0.3
Error Message:
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Checking the license for package Android SDK Platform 34 in C:\Users\LogithJ\AppData\Local\Android\Sdk\licenses
License for package Android SDK Platform 34 accepted.
Preparing "Install Android SDK Platform 34 (revision: 3)".
"Install Android SDK Platform 34 (revision: 3)" ready.
Installing Android SDK Platform 34 in C:\Users\LogithJ\AppData\Local\Android\Sdk\platforms\android-34
"Install Android SDK Platform 34 (revision: 3)" complete.
"Install Android SDK Platform 34 (revision: 3)" finished.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
aapt2.exe E 01-13 13:06:02 4124 1996 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data.
aapt2.exe E 01-13 13:06:02 4124 1996 ApkAssets.cpp:149] Failed to load resources table in APK 'C:\Users\LogithJ\AppData\Local\Android\Sdk\platforms\android-35\android.jar'.
error: failed to load include path C:\Users\LogithJ\AppData\Local\Android\Sdk\platforms\android-35\android.jar.
* 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 3m 10s
Running Gradle task 'assembleDebug'... 191.9s
┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Using compileSdk 35 requires Android Gradle Plugin (AGP) 8.1.0 or higher. │
│ Please upgrade to a newer AGP version. The version of AGP that your project uses is likely defined in: │
│ C:\Users\LogithJ\projects\<Project Name>\android\settings.gradle, │
│ in the 'plugins' closure (by the number following "com.android.application"). │
│ Alternatively, if your project was created with an older version of the templates, it is likely │
│ in the buildscript.dependencies closure of the top-level build.gradle: │
│ C:\Users\LogithJ\projects\<Project Name>\android\build.gradle, │
│ as the number following "com.android.tools.build:gradle:". │
│ │
│ Finally, if you have a strong reason to avoid upgrading AGP, you can temporarily lower the compileSdk version in the following file: │
│ C:\Users\LogithJ\projects\<Project Name>\android\app\build.gradle │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1```
compileSdkVersion 35 is required AGP 8.1.0 or newer
you can fix by update AGP version in settings.gradle
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.7.0" apply false <--- This one
id "org.jetbrains.kotlin.android" version "1.9.10" apply false <--- Kotlin version
}
or just downgrade your compileSdkVersion that compatible with your current AGP
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With