-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace 'compile' with 'implementation' in android/build.gradle #242
Conversation
tsmith5
commented
Feb 7, 2019
- Fixes WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation'. #241
- Replaces the now obsolete 'compile' for build.gradle dependencies with the newer 'implementation'
- Compiling any app that depends on this package should no longer complain about the use of 'compile'
- No updates to tests or readme required, just cleans up a warning.
It has to be noted that this will break the build for anyone that's using RN < 0.57. So this would a breaking change and version bump... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Good point @sraka1 - I'll add a note to the Readme. There will be a couple of breaking changes in the next release, so it'll definitely be a major version bump and this can be included. |
@sraka1 Sorry to be a bother, but could you explain how this change breaks RN < 0.57? I wasn't aware of it until you mentioned it. Thanks! |
@tsmith5 until 0.57 RN used Gradle2, which lacks the |
Personally, I’ll have to monkey-patch (or fork this package) to maintain compatibility with Gradle2 as we’re not ready to upgrade RN and/or Gradle just yet... |
@sraka1 that's actually a good point. Perhaps we should revert this and add a suggestion for using patch-package instead. |
This reverts commit 727945d.
Just a minor clarification for anyone else reading this in the future: This doesn't break the React Native package, what it breaks is Gradle <3. If you are running an older version of React Native (eg, 0.55.4) and upgrade to Gradle3 it will build fine. |
The README.md sends me here but doesn't really explain how to use patch-package to solve the compile/implementation problems. Are there any guides out there regarding how to use patch-package in this context? |
I see it has been a common misconception, so I'm sorry for the confusion. If you don't mind the warnings, feel free to do nothing. If you are using If however you do care about the warnings and you're on Gradle 3, you can do the following:
"scripts": {
+ "postinstall": "patch-package"
}
or
This basically adds a patch to the library every time you do an install. Once you can upgrade to v5 of this library you can simply delete the patch file and the package. |
I'm still getting this error on RN0.61.1 and RN0.64.0. The steps on the comment above solved the problem. |