Skip to content

Updated Android build.gradle for RN 0.57 #176

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

Closed
wants to merge 1 commit into from

Conversation

fiznool
Copy link

@fiznool fiznool commented Sep 6, 2018

React Native 0.57 will scaffold new projects using Gradle 3, instead of Gradle 2.

Users who install this library with Gradle 3 will see the following error:

Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

This PR fixes this warning.

Please note: this will cause any users who are still on Gradle 2 to see an error:

> Could not find method implementation() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

This is because implementation is only available for users of Gradle 3.

It may therefore be worth bumping the major version of this lib to indicate a breaking change for some users.

React Native 0.57 will [scaffold new projects using Gradle 3, instead of Gradle 2](facebook/react-native@6eac2d4).

Users who install this library with Gradle 3 will see the following error:

```
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
```

This PR fixes this warning.

Please note: this will cause any users who are still on Gradle 2 to see an error:

```
> Could not find method implementation() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
```

This is because `implementation` is only available for users of Gradle 3.

It may therefore be worth bumping the major version of this lib to indicate a breaking change for some users.
@fiznool
Copy link
Author

fiznool commented Sep 6, 2018

This PR also bumps the Android SDK compile/target version to 27, to match the forthcoming RN 0.57 release.

@mikehardy
Copy link

It's a bit of a treadmill, but gradle plugin 3.2.0 is out, and support libs 27.1.1 are current for API27

@mikehardy
Copy link

Also need to add 'google()' to the dependencies for build + allprojects

@damikdk
Copy link

damikdk commented Oct 15, 2018

Guys, we need this changes so much, any update here?

@luissmg
Copy link

luissmg commented Nov 2, 2018

@Traviskn can you take a look into this? This is kinda important!

@mikehardy
Copy link

react-native-share has already done something similar if you want to see what other RN modules have done - https://github.com/react-native-community/react-native-share/pull/373/files - but they moved to API 28, gradle 3.2.1 and the gradle wrappers and examples were updated as well. I could propose a similar PR (I authored that one) if you like, I use this library and I'm happy to help.

RN-share released that as a point release and there hasn't been much blowback - just one user affected that needed to add an excludes stanza for android support libs

@Traviskn
Copy link

we've updated to newer react native versions since this PR was opened

@Traviskn Traviskn closed this Sep 26, 2019
cguino pushed a commit to BeApp/rn-fetch-blob that referenced this pull request Jul 5, 2023
Declaring excludeFromBackupKey in index.d.ts so it is accessible in typescript.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants