According to the following SO post, compile
has become implementation
recently: What's the difference between implementation and compile in gradle
My question is what should I use instead of compileOnly
? The post above does not address that gradle config. I do know that I can still use compileOnly
but what is the recommended config that will not be deprecated soon?
It seemed like all configs that contain ..compile..
would be replaced by ..implementation..
. I tried implementationOnly
but not accepted by Android Studio.
compileOnly is the replacement — the equivalent configuration that is being deprecated is provided .
compileOnly. Gradle adds the dependency to the compile classpath only (that is, it is not added to the build output). This is useful when you're creating an Android module and you need the dependency during compilation, but it's optional to have it present at runtime.
implementation – required to compile the production source code and are purely internal. They aren't exposed outside the package. compileOnly – used when they need to be declared only at compile-time, such as source-only annotations or annotation processors.
Gradle files and your application code need to be synced if any Gradle file changes, for example when updating dependencies or adding new dependencies manually. Android Studio should automatically sync the project with Gradle when you robotify your app (ie make it compatible with Pepper's tablet).
compileOnly
is the replacement — the equivalent configuration that is being deprecated is provided
. See the documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With