Skip to content

Replace 'compile' with 'implementation' in android/build.gradle #242

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Feb 7, 2019

Conversation

tsmith5
Copy link
Contributor

@tsmith5 tsmith5 commented Feb 7, 2019

@sraka1
Copy link

sraka1 commented Feb 7, 2019

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...

Copy link
Contributor

@kadikraman kadikraman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kadikraman
Copy link
Contributor

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.

@kadikraman kadikraman added this to the Next Release 🚀 milestone Feb 7, 2019
@kadikraman kadikraman merged commit 727945d into FormidableLabs:master Feb 7, 2019
@tsmith5 tsmith5 deleted the fix/issue-241 branch February 7, 2019 21:42
@tsmith5
Copy link
Contributor Author

tsmith5 commented Feb 8, 2019

@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!

@sraka1
Copy link

sraka1 commented Feb 9, 2019

@tsmith5 until 0.57 RN used Gradle2, which lacks the implementation directive introduced in Gradle3. Furthermore, while Gradle3 emits a warning about this (deprecated, not removed), the build would still pass meanwhile on Gradle2 (so RN < 0.57) the build will definitely fail...

@sraka1
Copy link

sraka1 commented Feb 9, 2019

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...

@kadikraman
Copy link
Contributor

@sraka1 that's actually a good point. Perhaps we should revert this and add a suggestion for using patch-package instead.

@kadikraman kadikraman modified the milestones: Next Major Release 🚀, Next Minor Release 🎉 Feb 18, 2019
kadikraman pushed a commit that referenced this pull request Feb 18, 2019
kadikraman added a commit that referenced this pull request Feb 18, 2019
…adle (#249)

* Revert "Replace 'compile' with 'implementation' (#242)"

This reverts commit 727945d.

* Add readme comment on patch package
@tsmith5
Copy link
Contributor Author

tsmith5 commented Mar 18, 2019

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.

@barrymichaeldoyle
Copy link

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?

@kadikraman
Copy link
Contributor

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 react-native-app-auth@5.0.0 or above DO NOTHING - this is already included in the release.

If however you do care about the warnings and you're on Gradle 3, you can do the following:

  1. open node_modules/react-native-app-auth/android/build.gradle and mirror the changes in this PR
  2. run npx patch-package some-package (this will create a .patch file)
  3. commit the patch to your source control
  4. in package.json add a postistall script:
 "scripts": {
+  "postinstall": "patch-package"
 }
  1. add the library as a dependency
yarn add patch-package postinstall-postinstall

or

npm i patch-package

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.

@williamtorres1
Copy link
Contributor

I'm still getting this error on RN0.61.1 and RN0.64.0. The steps on the comment above solved the problem.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation'.
5 participants