- By following below steps I am able to get the react native maps working in ios simulator,
- but for android I am getting the below issue
Could not determine the dependencies of task ':app:mergeProdReleaseAssets'.> Could not resolve all task dependencies for configuration ':app:prodReleaseRuntimeClasspath'.> Could not find com.google.android.gms:play-services-base:19.1.0. Searched in the following locations: - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar - dl.google.com/dl/android/maven2/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - dl.google.com/dl/android/maven2/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar - jcenter.bintray.com/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - ://jcenter.bintray.com/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar - ://jitpack.io/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - ://jitpack.io/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar Required by: project :app > project :react-native-maps> Could not find com.google.android.gms:play-services-maps:19.1.0. Searched in the following locations: - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar - //dl.google.com/dl/android/maven2/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom - ://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar - ://jcenter.bintray.com/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom - ://jcenter.bintray.com/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar - ://jitpack.io/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom - ://jitpack.io/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar Required by: project :app > project :react-native-maps> Could not find com.google.android.gms:play-services-base:19.1.0. Searched in the following locations: - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar - dl.google.com/dl/android/maven2/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - dl.google.com/dl/android/maven2/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar - jcenter.bintray.com/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - jcenter.bintray.com/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar - jitpack.io/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom - jitpack.io/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar Required by: project :app > project :react-native-geolocation-service > com.google.android.gms:play-services-location:17.0.0
Add Google Maven repository and sync projectShow in Project Structure dialogAffected Modules: react-native-maps
-so I googled and found the the below link and in the app build.gradle I used the below configuration, but still same issue.- i even changed react-native-maps node modules build.gradle but still no luck.- can you tell me how to fix it.providing my androidmanifest.xml, build.gradle which is present in app and android folder
build.gradle which is present in app
apply plugin: "com.android.application"import com.android.build.OutputFileproject.ext.react = [ entryFile: "index.js", enableHermes: false, // clean and rebuild if changing]project.ext.envConfigFiles = [ dev : ".env", qa : ".env.qa", uat : ".env.uat", prod: ".env.prod",]apply from: "../../node_modules/react-native/react.gradle"/** * Set this to true to create two separate APKs instead of one: * - An APK that only works on ARM devices * - An APK that only works on x86 devices * The advantage is the size of the APK is reduced by about 4MB. * Upload all the APKs to the Play Store and people will download * the correct one based on the CPU architecture of their device. */def enableSeparateBuildPerCPUArchitecture = false/** * Run Proguard to shrink the Java bytecode in release builds. */def enableProguardInReleaseBuilds = true/** * The preferred build flavor of JavaScriptCore. * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */def jscFlavor = 'org.webkit:android-jsc:+'/** * Whether to enable the Hermes VM. * * This should be set on project.ext.react and mirrored here. If it is not set * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode * and the benefits of using Hermes will therefore be sharply reduced. */def enableHermes = project.ext.react.get("enableHermes", false);android { compileSdkVersion rootProject.ext.compileSdkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { applicationId "com.seven.eleven.sports" resValue "string", "build_config_package", "com.seven.eleven.sports" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" multiDexEnabled true } flavorDimensions "default" productFlavors { dev { // Pre-compile run ENVFILE=.env.dev dimension "default" applicationIdSuffix ".dev" versionNameSuffix "-dev" resValue "string", "app_name", "7-Track_DEV" } qa { // Pre-compile run ENVFILE=.env.dev dimension "default" applicationIdSuffix ".qa" versionNameSuffix "-qa" resValue "string", "app_name", "7-Track_QA" } uat { // Pre-compile run ENVFILE=.env.dev dimension "default" applicationIdSuffix ".uat" versionNameSuffix "-uat" resValue "string", "app_name", "7-Track_UAT" } prod { // Pre-compile run ENVFILE=.env.prod dimension "default" versionNameSuffix "" resValue "string", "app_name", "7-Track" } } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } signingConfigs { debug { storeFile file('debug.keystore') storePassword 'android' keyAlias 'androiddebugkey' keyPassword 'android' } } buildTypes { debug { signingConfig signingConfigs.debug applicationIdSuffix ".dev" resValue "string", "app_name", "7-Track_DEV" } release { // Caution! In production, you need to generate your own keystore file. // see facebook.github.io/react-native/docs/signed-apk-android. signingConfig signingConfigs.debug shrinkResources enableProguardInReleaseBuilds zipAlignEnabled enableProguardInReleaseBuilds minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" minifyEnabled true } } // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // //developer.android.com/studio/build/configure-apk-splits.html def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = versionCodes.get(abi) * 1048576 + defaultConfig.versionCode } } }}dependencies {// implementation(project(':react-native-maps')){// exclude group: 'com.google.android.gms', module: 'play-services-base'// exclude group: 'com.google.android.gms', module: 'play-services-maps'// }// implementation 'com.google.android.gms:play-services-base:10.0.1'// implementation 'com.google.android.gms:play-services-maps:10.0.1' implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.facebook.react:react-native:+" // From node_modules implementation 'androidx.appcompat:appcompat:1.1.0-rc01' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02' if (enableHermes) { def hermesPath = "../../node_modules/hermes-engine/android/"; debugImplementation files(hermesPath +"hermes-debug.aar") releaseImplementation files(hermesPath +"hermes-release.aar") } else { implementation jscFlavor }}// Run this once to be able to run the application with BUCK// puts all compile dependencies into folder libs for BUCK to usetask copyDownloadableDepsToLibs(type: Copy) { from configurations.compile into 'libs'}apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle");applyNativeModulesAppBuildGradle(project)apply from: project(':react-native-config').projectDir.getPath() +"/dotenv.gradle"
build.gradle which is present in android
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { ext { buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 playServicesVersion = "19.1.0" } repositories { google() jcenter() } dependencies { classpath('com.android.tools.build:gradle:3.5.3') // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}allprojects { repositories { mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url("$rootDir/../node_modules/react-native/android") } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } google() jcenter() maven { url 'jitpack.io' } // maven { // url 'maven.google.com/' // name 'Google' // } }}**react-native-maps build.gradle files**
apply plugin: 'com.android.library'if (project.hasProperty('POM_ARTIFACT_ID')) { apply from: 'gradle-maven-push.gradle'}def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback}android { compileSdkVersion safeExtGet('compileSdkVersion', 28) defaultConfig { minSdkVersion safeExtGet('minSdkVersion', 16) targetSdkVersion safeExtGet('targetSdkVersion', 27) }}dependencies { def supportLibVersion = safeExtGet('supportLibVersion', '28.0.0') def supportLibMajorVersion = supportLibVersion.split('\\.')[0] as int def appCompatLibName = (supportLibMajorVersion < 20) ? "androidx.appcompat:appcompat" : "com.android.support:appcompat-v7" implementation "$appCompatLibName:$supportLibVersion" implementation('com.facebook.react:react-native:+') { exclude group: 'com.android.support' } implementation "com.google.android.gms:play-services-base:${safeExtGet('playServicesVersion', '17.0.0')}" implementation "com.google.android.gms:play-services-maps:${safeExtGet('playServicesVersion', '17.0.0')}" implementation "com.google.android.gms:play-services-location:17.0.0" implementation 'com.google.maps.android:android-maps-utils:0.5'}
package.json
{"name": "sports","version": "0.0.1","private": true,"scripts": {"ios": "react-native run-ios","start": "react-native start","android-clean": "echo 'CLEANING ...'&& cd android/ && ./gradlew clean && cd ..","android-build-all": "build_scripts/start_build_android.sh","android": "react-native run-android --variant=devDebug --appIdSuffix=dev","android-prod": "react-native run-android --variant=prodRelease","android-qa": "react-native run-android --variant=qaRelease --appIdSuffix=qa","android-uat": "react-native run-android --variant=uatRelease --appIdSuffix=uat","ios-dev": "react-native run-ios --scheme sports","ios-qa": "react-native run-ios --scheme sportsQA","ios-uat": "react-native run-ios --scheme sportsUAT ","ios-prod": "react-native run-ios --scheme sportsPROD","test": "jest","lint": "eslint . --ext .js,.jsx,.ts,.tsx" },"dependencies": {"@react-native-community/async-storage": "^1.8.1","@react-native-community/masked-view": "^0.1.6","@react-navigation/bottom-tabs": "^5.0.7","@react-navigation/drawer": "^5.0.7","@react-navigation/native": "^5.0.7","@react-navigation/stack": "^5.0.8","axios": "^0.19.2","axios-retry": "^3.1.2","haversine": "^1.1.1","immutable": "^4.0.0-rc.12","jwt-decode": "^2.2.0","moment": "^2.24.0","react": "16.9.0","react-devtools": "^4.4.0","react-jwt-store": "^1.7.0","react-native": "0.61.5","react-native-check-box": "^2.1.7","react-native-config": "^0.12.0","react-native-elements": "^1.2.7","react-native-geolocation-service": "^4.0.0","react-native-gesture-handler": "^1.6.1","react-native-keyboard-aware-scroll-view": "^0.9.1","react-native-lazyload": "^1.1.0","react-native-maps": "0.27.1","react-native-orientation-loading-overlay": "^0.1.6","react-native-picker-select": "^6.6.0","react-native-ratings": "^6.5.0","react-native-reanimated": "^1.7.0","react-native-safe-area-context": "^0.7.3","react-native-screens": "^2.2.0","react-native-scrolling-menu": "^0.1.1","react-native-sendgrid": "^1.0.1","react-native-sha256": "^1.3.6","react-native-splash-screen": "^3.2.0","react-native-table-component": "^1.2.1","react-native-vector-icons": "^6.6.0","react-native-webview-leaflet": "^5.0.2","react-navigation": "^4.2.1","react-navigation-stack": "^1.10.3","react-redux": "^7.2.0","react-swipeable-views-native": "^0.13.2","react-use": "^13.27.1","redux": "^4.0.5","redux-devtools-extension": "^2.13.8","redux-persist": "^6.0.0","redux-persist-transform-immutable": "^5.0.0","redux-saga": "^1.1.3","redux-saga-jwt": "^1.0.4-beta.0","redux-thunk": "^2.3.0","toggle-switch-react-native": "^2.1.0" },"devDependencies": {"@babel/core": "^7.9.0","@babel/preset-env": "^7.9.0","@babel/runtime": "^7.8.4","@react-native-community/eslint-config": "^0.0.5","@types/jest": "^24.0.24","@types/react-native": "^0.60.25","@types/react-test-renderer": "16.9.1","@typescript-eslint/eslint-plugin": "^2.12.0","@typescript-eslint/parser": "^2.12.0","babel-core": "^6.26.3","babel-jest": "^25.1.0","babel-preset-env": "^1.7.0","eslint": "^5.16.0","jest": "^25.1.0","metro-react-native-babel-preset": "^0.56.0","react-native-obfuscating-transformer": "^1.0.0","react-test-renderer": "16.9.0","remote-redux-devtools": "^0.5.16","typescript": "^3.7.3" },"jest": {"preset": "react-native","moduleFileExtensions": ["ts","tsx","js","jsx","json","node" ] }}
androidmanifest.xml,
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.seven.eleven.sports"><uses-permission android:name="android.permission.INTERNET" /><application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme"><!-- You will only need to add this meta-data tag, but make sure it's a child of application --><meta-data android:name="com.google.android.geo.API_KEY" android:value=""/><!-- You will also only need to add this uses-libray tag --><uses-library android:name="org.apache.http.legacy" android:required="false"/><activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:windowSoftInputMode="adjustResize"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity><activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /></application></manifest>