AAPT2 TLS Handshake Failure After Upgrading to Android SDK 35, AGP 8.2.2, and JDK 17 on Windows
09:01 23 Feb 2026

I recently upgraded my old Android project (previously targetSdkVersion 28 and compileSdkVersion 28) to API 35.

Here’s what I changed:

1: Installed JDK 17 (Temurin 17.0.18)

2: Installed Android Studio Hedgehog

3: Changed project JDK to 17

4: Installed Android API 35

5: Updated compileSDKVision = 35 and targetSDKVersion = 35

6: Updated Android Gradle Plugin to 8.2.2

7: Updated Gradle wrapper to 8.4

Sync was successful, but APK generation fails with this error:

Task :app:mergeReleaseResources

Task :app:mergeReleaseResources FAILED
Execution failed for task ':app:mergeReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
Could not isolate value com.android.build.gradle.internal.res.Aapt2CompileRunnable$Params_Decorated@914c721 of type Aapt2CompileRunnable.Params
Could not resolve all files for configuration ':app:detachedConfiguration2'.
Could not resolve com.android.tools.build:aapt2:8.2.2-10154469.
Required by:
project :app
Could not resolve com.android.tools.build:aapt2:8.2.2-10154469.
Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/8.2.2-10154469/aapt2-8.2.2-10154469.pom'.
Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/8.2.2-10154469/aapt2-8.2.2-10154469.pom'.
The server may not support the client's requested TLS protocol versions: (TLSv1.2). You may need to configure the client to allow other protocols to be used. For more on this, please refer to https://docs.gradle.org/8.4/userguide/build_environment.html#sec:gradle_system_properties in the Gradle documentation.
Remote host terminated the handshake
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.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 1h 39m 30s

28 actionable tasks: 28 executed

Here are what I have done to resolve the problem:

1: set systemProp.https.protocols=TLSv1.2

2: Deleted .gradle/caches and wrapper

3: disable Windows Firewall

I don't know what the problem could be, I have been trying to resolve this for weeks but all to no avail. I will be very grateful if anyone could help me resolve this.

android android-studio gradle tls1.2 aapt2