Skip to content

API 'variant.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.

Snoy-Kuo edited this page Mar 17, 2022 · 1 revision

Messages

API 'variant.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.

Description

The Android Studio project can build and run, but got this warning.
This happened when using variant.getPackageApplication() in gradle files. Usually we use it for modifying output apk names.

Dev env

  • macOS 11.6 (Big Sur) x64
  • Android Studio Bumblebee Patch 1
  • Android SDK version 27
  • buildTool: 28.0.3
  • Android Gradle Plugin: 3.3.3
  • Gradle: 4.10.3
  • Gradle JDK: corretto-1.8
  • Kotlin: 1.3.72

Tried approaches

Solutions