-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix Android dependencies and build errors #2720
Fix Android dependencies and build errors #2720
Conversation
LGTM @rborn 🐽 |
5921602
to
4f6c684
Compare
@friederbluemle What i recommend by mine good practice is to separate iOS and Android specific changes as two PRs. It could be checked and tested separately. This PR is not change in couple files, but 26. It could helps to merge it faster when it will be as two independent pull requests. Do you think use Gradle 5.2.x is good idea? RN 0.58 uses 4.10.2, even RN0.59 will use 4.10.2. Gradle 5.0 lands in RN master branch just 12 days ago. I think 4.10 is safe now. |
Anyway iOS changes looks good to me. |
4f6c684
to
39590ec
Compare
@radeno - Thanks a lot for the review and the comment! 👍 As you suggested, I downgraded the Gradle wrapper to I also excluded the ios changes (Podfile.lock) - I'll open a separate PR once this one is in. It should make the review a bit easier. |
39590ec
to
58f8bcc
Compare
@friederbluemle i'm not an Android expert so lets get inspiration from https://github.com/react-native-community/react-native-netinfo which is community repo from other community repos taking inspiration in Lean Core initiative. All gradle files from root folder should be deleted or moved to right place. We need only related for build in Can you check it please? |
@radeno - Yes good point. Do you suggest we should also do it in this PR as well or do keep it separate? As you mentioned I am not introducing any new legacy tech debt with this PR (only clean up, removing files, and updating/moving existing files). I agree there is more follow up work to be done. I have some pending wip on a separate branch locally that moves the wrapper from the root directory (I think that should be taken care of separately). |
@friederbluemle in my opinion it should be good move to transfer them into correct directories by this PR. Most gradle files from root directory belongs to example directory. So i think, yes lets move it. |
- Delete compiled files - Remove obsolete Gradle wrapper leftover - Remove Eclipse project leftover
- Update Gradle wrapper to 4.10.3 - Update Android Gradle plugin to 3.2.1 - Remove unused appcompat-v7 dependency from lib project
58f8bcc
to
8811ba3
Compare
@radeno - To make the PR review easier and lower the impact/risk, would it be possible to use two PRs? This PR here does not create any new files, just updates existing ones. I will open a follow up PR right after this on is in. We are already successfully using an internal fork with the changes on this PR. |
@friederbluemle for me it doesnt matter because test case is easy. Will it work or will not :) but i am not maintaner. |
@friederbluemle unfortunately I'm unable to run
Should I create an issue? Thanks |
@grifotv Thanks for the report. I'm checking now! |
Confirming the build error that @grifotv reported. I missed including a small change in this PR that I had locally. Sorry about that. I opened a PR with the fix here: #2727 @christopherdro @alvelig @rborn - Please check, hopefully we can get this merged quickly. Thanks and sorry again for the oversight! |
Merged |
@friederbluemle it looks like some people still have issues with a missing line in build.gradle This PR only includes it in example, but not in the Do we need to add it there or they are using an older version of the module? ( didn't have time to test :( ) |
@rborn Thanks for the heads up! Looking into it! |
@rborn - Looking at the comments in the other thread, these people were not using the I checked the code again, and there are definitely no dependencies on However, there are a couple of dependencies on
The issues people are having are most likely related to the way dependencies are declared in the app project, and the resulting conflicts. https://docs.gradle.org/current/userguide/customizing_dependency_resolution_behavior.html Other possible solutions/workarounds include:
or
Ideally there should be no need to modify files inside of the |
@friederbluemle thank you very much for the investigation. Let's keep it like his for now and keep an eye on it. Thanks again ❤️ |
Sorry if I missed it, but is there a reason why this PR takes out the ability of react-native-maps to use the googlePlayServicesVersion in your top level gradle file? That ability was added in PR #2047 |
@arosendorff - Good question! The library (and its source code) is built against and guaranteed to work with one specific version of the However: It does seem like this unfortunately is the prevalent, "recommended", and only (?) way dependencies of React Native apps are handled, at least at the moment. In any case, I do admit this was a mistake on my end, and it's not the job of this repository/library to change the way React Native dependencies are consumed, so I've added this functionality back in this PR right here: #2765 |
@arosendorff #2765 was merged, please test with the last master. Thanks for your observation 🤗 |
@friederbluemle I get what you're saying about the required @rborn Perfect, thanks so much! 🙂 |
* Update yarn.lock * Remove obsolete files and folders - Delete compiled files - Remove obsolete Gradle wrapper leftover - Remove Eclipse project leftover * Update .gitignore * Fix Android dependencies and build errors - Update Gradle wrapper to 4.10.3 - Update Android Gradle plugin to 3.2.1 - Remove unused appcompat-v7 dependency from lib project
Hello ! Since this PR is merged, the build gradle parameter: androidMapsUtilsVersion is not use anymore. (the commit: 8811ba3#diff-c6899e54b9ed67b2d9034a841311198095bc6419675fc9f59874312c341fe414L59). Is it normal ? |
Hi @appli-intramuros - Yes, this is normal. If you require a different version of the dependency, you could try Gradle dependency substitution (only works for versions that are backwards compatible) - or - (preferred) submit a PR to this repo and update to the latest version. |
Does any other open PR do the same thing?
No
What issue is this PR fixing?
Currently, the yarn tasks
start:android
andrun:android
to build and run the Android version are failing on themaster
branch with the following error:This is caused by partially and incorrectly updated dependencies of the Android build system, which was addressed by updating the dependencies as described below. Many obsolete and unused leftover files of old Gradle wrapper installations and a couple of files from the Eclipse days were removed as well.
The three main things this PR addresses is:
appcompat-v7
dependency from library projectSee individual commits for more details.
How did you test this PR?
Correct behavior (build and run) was verified using an Android device, an Android emulator, and an iOS simulator.
Includes and closes #2712
Also fixes #2663
Once approved, please use a normal GitHub merge (i.e. NO rebase/squash merge) to integrate the commit(s) from the branch of this pull request. The changes are broken up into meaningful, atomic commits, and my branch should already be up-to-date with the latest target branch. If it isn't, or if you'd like me to combine something, please let me know, and I will make the necessary updates as soon as possible. Thank you!