react-native-maps: Unable to resolve Gradle dependencies
Is this a bug report?
Yes
Have you read the Installation Instructions?
Yes
Environment
react-native: 0.57.4 react: 16.6.0-alpha.8af6728 react-native-maps: 0.23.0
Target Platform: Android 9 Emulator, Nexus 5 X
Steps to Reproduce
- Follow the installation guide to configure the global settings.gradle and app’s build.gradle
- Hit the Android Studio Gradle’s Sync now button
Expected Behavior
I expect the react-native-maps project to be included in the main project
and all its dependencies to get resolved by Gradle itself.
Actual Behavior
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-compat:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-annotations:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-core-utils:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-core-ui:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-fragment:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-annotations:27.1.1.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-core-utils:27.1.1.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-fragment:27.1.1.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-compat:27.1.1.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-core-ui:27.1.1.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-compat:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-core-utils:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-core-ui:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-fragment:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@debug/compileClasspath': Could not resolve com.android.support:support-annotations:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-compat:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-annotations:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-core-utils:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-core-ui:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-fragment:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-annotations:27.1.1.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-core-utils:27.1.1.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-fragment:27.1.1.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-compat:27.1.1.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-core-ui:27.1.1.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-compat:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-core-utils:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-core-ui:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-fragment:25.2.0.
Open File
Show Details
Unable to resolve dependency for ':react-native-maps@release/compileClasspath': Could not resolve com.android.support:support-annotations:25.2.0.
Open File
Show Details
Reproducible Demo
My rootProject variable versions are
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
googlePlayServicesVersion = "11.8.0"
androidMapsUtilsVersion = "0.5+"
}
To reproduce the issue i have placed the above piece of code in my root build.gradle and have followed the installation guide for Android step by step.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 8
- Comments: 25 (3 by maintainers)
@alvelig if this can help I’m sharing my app build.gradle and global build.gradle along with the way I was able to solve the dependency resolving issue manually.
build.gradle (app)
build.gradle (project)
In order to solve the issue I had to use this configuration, as suggested by @JosefBlattler
along with adding this line to the end of react-native-maps build.gradle in the dependencies declaration
Hope this can help!
This issue has been fixed for me also by adding this line into the react-native-maps 's build.gradle file
important : what I didn’t catch immediately is that this line should be added directly in the node_modules/react-native-maps/lib/android/build.gradle
Thanks @michaelsinatra !
OK, a spend so much time for a solution, and find this: In your root android folder, open build.gradle and paste this in maven:
should be something like this:
This work for me, I hope for you too
It works:
Você resolveu o meu problema! Obrigado
Hi @michaelsinatra thanks for providing this information. I added this line in my node_modules and it works again. So I create also small PR #2702 based on this. Maybe some of you can also verify that this PR works also for you?!
Thanks
@truongluong1314520 that’s fine, it’s a deprecation warning that has already a PR in works https://github.com/react-native-community/react-native-maps/pull/2740
But it should work for now without any problem. Thank you for testing 🤗
I am getting this error
When I change to @michaelsinatra solution, any thoughts?
Sorry @rborn, it was my mistake. I tested with the master version and it worked perfect. Thanks!
I hope you know that you are a lifesaver @michaelsinatra
Hi @rborn , I try this link
github:react-native-community/react-native-maps#masterand everything seem to work find except there is a warning:@truongluong1314520 this should be fixed in #https://github.com/react-native-community/react-native-maps/pull/2720 can you test with master please?
Any above solution doesn’t work at all. “react-native”: “^0.58.4” “react”: “16.6.3”, “react-native-maps”: “0.22.0”