Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Gradle Plugin: Property 'applicationId' is not annotated with an input or output annotation

I recently upgraded my Android Studio (and Gradle Plugin) to version 4.0, and now when I build my project I get:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use --warning-mode all to show the individual deprecation warnings.

Then, when I set org.gradle.warning.mode=all in gradle.properties, I get this below :app:generateSafeArgsDebug task:

Property applicationId is not annotated with an input or output annotation. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0.

Property applicationIdResource is not annotated with an input or output annotation. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0.

I've read Gradle version 6.1.1 and plugin version 4.0.0 in android studio in Gradle Forums, which suggests that the problem could be caused by outdated dependencies, but I have all the latest versions and the problem remains.

How can I fix this warning?

like image 937
lcnicolau Avatar asked Jun 24 '20 16:06

lcnicolau


1 Answers

"androidx.navigation:navigation-safe-args-gradle-plugin" is the cause of the "app:generateSafeArgsDebug" task.

By upgrading it (to the 2.3.1 version, for example), theses warnings will disappear.

Other warnings will raise:

WARNING: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
It will be removed in version 5.0 of the Android Gradle plugin.
WARNING: API 'BaseVariant.getApplicationIdTextResource' is obsolete and has been replaced with 'VariantProperties.applicationId'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see TBD.
To determine what is calling BaseVariant.getApplicationIdTextResource, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

But maybe easier to solve (and less stacktrace-styled)

like image 155
Romain DEQUIDT Avatar answered Sep 18 '22 04:09

Romain DEQUIDT