Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

When building gradle I'm getting this message:

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

I'm using Android Studio 4.1 Canary 10 and gradle:4.1.0-alpha10

like image 327
Biscuit Avatar asked Jun 02 '20 16:06

Biscuit


3 Answers

It seems like the Navigation Safe Args plugin uses getApplicationIdTextResource(), so it is most likely that the error message is caused by your usage of that plugin.

You'd want to star the existing issue to ask the Safe Args plugin to use the new replacement API.

like image 69
ianhanniballake Avatar answered Nov 09 '22 14:11

ianhanniballake


Changing to androidx.navigation:navigation-*:2.4.0-alpha02 as described here allowed a build of my app under Arctic Fox without getting the getApplicationIdTestResource warning

From the application build.gradle file:

def nav_version = "2.4.0-alpha02"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"

And in the build.gradle file:

def nav_version = "2.4.0-alpha02"
implementation "androidx.navigation:navigation-fragment:$nav_version"
implementation "androidx.navigation:navigation-ui:$nav_version"
androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"
like image 36
Spirit of the Void Avatar answered Nov 09 '22 13:11

Spirit of the Void


few days i see the same issue. Then i go to -> build.gradle file

My Dependencies before update

check the dependencies

I update the dependencies google services to 4.3.4

dependencies {
    classpath 'com.android.tools.build:gradle:4.1.1'
    classpath 'com.google.gms:google-services:4.3.4'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

After update

Now its working fine.

like image 9
Riaz Mahmud Avatar answered Nov 09 '22 15:11

Riaz Mahmud