I spent 5 hours scratching my head over this error:
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
aapt2 E LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data.
aapt2 E ApkAssets.cpp:149] Failed to load resources table in APK '/Users/xxx/Library/Android/sdk/platforms/android-35/android.jar'.
error: failed to load include path /Users/xxx/Library/Android/sdk/platforms/android-35/android.jar.
Even “vibe coding” couldn’t save me 😅, so I dug through StackOverflow and finally found a fix. Sharing it here to save you the pain.
Why this happens
Android SDK 35 ships a different android.jar. Older Gradle/AGP versions can’t parse it properly with the bundled aapt2, so resource linking fails.
The Fix
Open your gradle.properties in the Flutter project root.
Add the following line (replace /Users/xxx with your SDK path):
android.aapt2FromMavenOverride=/Users/xxx/Library/Android/sdk/build-tools/35.0.0/aapt2
Clean and rebuild:
./gradlew clean
./gradlew assembleDebug --stacktrace
🎉 That’s it! After adding this, my Flutter app built successfully again on Android 35.
If you hit this error, give it a try. And if you discover another workaround, share it below so others can benefit!
Top comments (0)