I get these two lines when compiling an old Android project using latest Android Studio (3.1.4):
WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation' and 'testApi'.
WARNING: Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
I understand what they mean and how I can fix these warnings, there are also questions explaining it, but I can't any reference to 'testApi' anywhere on developer.android.com. Is it an error in warnings or was there testApi command? Was it added alongside 'testImplementation' and was later deprecated?
Previously we used testCompile but as per the last Gradle update Android Studio sometimes shows this messages though we edit the gradle file with new keywords.Now the "testApi" was not there in gradle as per my own experience.I think this error message is a fault.
Related
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?
"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)
When using com.android.tools.build:gradle:3.3.0-beta01, gradle fail with:
ERROR: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
I search in the documentation but I don't find how to raise warning, not error. End of 2019 is not here yet.
It happened to me and the problem was solved by commenting on the Fabric plugin in gradle.
If your case is the same but you need to continue using the Fabric, I recommend going back to the to the previous version of the gradle at the project level.
Change the classpath version to com.android.tools.build:gradle:3.2.1.
I followed the example project for the Google Maps SDK as found here, and it works perfectly. However the syntax highlighting in the MapsMarkerActivity is mostly red as shown in the picture.
I'm curious as to why this is and how I'd go about fixing it.
On another note, the compiler also prints out the following warnings:
[![WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
WARNING: Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation' and 'androidTestApi'.
WARNING: Configuration 'androidTestApi' is obsolete and has been replaced with 'androidTestImplementation'.
WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation' and 'testApi'.
WARNING: Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.][2]][2]
Where would I find these outdated bits of code and what would be the best way to go about replacing them?
1.For red underline, probably is a lint bug, try update android studio and gradle plugin to latest version. If still failed, disable the lint option as below image:
2 For these warning, just do as IDE prompts,for example,replace compile with implementation. the other warnings are same handled.
implementation 'com.android.support:appcompat-v7:28.0.0'
I am new to Android Studio.
need to Migrate an old project to Android Studio
First I got this error :
android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor'..
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information ...
Then when I make the changes and replace what i need to i get this error:
'keyboard|screenSize|orientation|' is incompatible with ...
anyone having idea about this please help
For the android-apt error refer:
Incompatible plugins for android-apt after upgrading to Android Studio 2.3
Also, in your app gradle file, under dependencies section, change compile to implementation. (compile will be deprecated at the end of 2018, you should use implementation instead).
For the second one, it seems like (according to the image) that you have an extra | at the end (keyboard|screenSize|orientation|) try to remove it.
Next time please attach the code itself, it will be much easier to find what's wrong.
Ok, I know this question has been asked over and over and its usually something simple within your own build config that you need to update. However, I keeping seeing:
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. warning message.
I have already checked that I am using the latest of the google services:
'com.google.gms:google-services:4.0.1'
I've cleaned, rebuilt, invalidated cache with restart, and yet nothing changes. At this point my best guess is that this may be an underlying issue with 3rd party libs that I am importing. Could it be that they nay not be up to date with the implementation switch? Is there a way to find out which library would be the root cause, outside of me having to manually inspect each one of them?
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
This warning message is normal as you may be using a later version of Android Studio with android gradle plugin 3.0 or above.
compile, provided, and apk are currently still available. However, they will be removed in the next major release of the Android plugin.
See https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration for more details.
I found that the issue was a 3rd party lib/tool(s). The project I have inherited was including, but not actually using, Freeline Build Tool & Hugo. The moment I commented these out in both of the gradle files (project and app level) the warnings went away.