I am using Android Studio Iguana | 2023.2.1
Build #AI-232.10227.8.2321.11479570, built on February 22, 2024
Runtime version: 17.0.9+0-17.0.9b1087.7-11185874 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.4.1
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Metal Rendering is ON
By default, it only list the tasks about test.
Only test tasks are configured during Gradle Sync. Configuring all tasks can impact Gradle Sync performance on large projects.
Show experimental settings...

Then I go to Settings -> Experimental, checked "Configure all Gradle tasks during Gradle Sync (this can make Gradle Sync slower)".

Solution 2: Use terminal instead.
./gradlew tasks --all
net-security:uploadArchives - Uploads all artifacts belonging to configuration ':net-security:archives'
find the task you want, for me, it is
./gradlew net-security:uploadArchives