API 'BaseVariant.getApplicationIdTextResource' is obsolete and has been replaced with 'VariantProperties.applicationId'

后端 未结 6 1761
时光说笑
时光说笑 2021-02-03 17:36

When building gradle I\'m getting this message:

API \'BaseVariant.getApplicationIdTextResource\' is obsolete and has been replaced with \'VariantPr

6条回答
  •  礼貌的吻别
    2021-02-03 18:20

    It will be solved, when 4.2.0 is stable.

    From the existing issue:

    Android Gradle Plugin deprecated the getApplicationIdTextResource() API on the class BaseVariant in version 4.1.0 (see bug). The replacement API (onVariantProperties) did not work properly for feature libraries, so to avoid the deprecation warning, reflection was used. That is only a short term solution, and when AGP 4.2.0 is stable we should update to that version and remove the reflection immediately

    So if you need Safe Args and do not need latest features of Gradle, keep Gradle version in Android Gradle Plugin version at 3.6.4. Once stable 4.2.0 released, update to the latest.

提交回复
热议问题