Related
ERROR..BUILD FAILED
This is my Package.json
{
"name": "eMembershipCard",
"version": "0.0.4",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"android_emembershipcard": "react-native run-android --variant=emembershipcardDebug --appIdSuffix = 'membershipdemo' ",
"android_omaha": "react-native run-android --variant=omahaDebug --appIdSuffix = 'ocm' ",
"android_magichouse": "react-native run-android --variant=magichouseDebug --appIdSuffix = 'magichouse' ",
"ios_emembershipcard": "react-native run-ios --scheme eMembershipCard --configuration eMembershipCard",
"ios_omaha": "react-native run-ios --scheme omaha --configuration omaha",
"ios_magichouse": "react-native run-ios --scheme magichouse --configuration magichouse",
"emembership-build": "cd android && ./gradlew assembleemembershipcardRelease",
"emembership-build-debug": "cd android && ./gradlew assembleemembershipcardDebug",
"omaha-build-debug": "cd android && ./gradlew assembleomahaDebug",
"magichouse-build-debug": "cd android && ./gradlew assemblemagichouseDebug",
"emembership-build-debug-bundle": "cd android && ./gradlew bundleemembershipcardDebug",
"omaha-build-debug-bundle": "cd android && ./gradlew bundleomahaDebug",
"magichouse-build-debug-bundle": "cd android && ./gradlew bundlemagichouseDebug"
},
"dependencies": {
"#react-native-async-storage/async-storage": "^1.16.0",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-community/netinfo": "^7.1.5",
"#react-native-firebase/app": "^14.12.0",
"#react-native-firebase/messaging": "^14.2.2",
"#react-navigation/drawer": "^6.1.8",
"#react-navigation/native": "^6.0.6",
"#react-navigation/stack": "^6.0.11",
"android": "^0.0.8",
"axios": "^0.24.0",
"linkify-html": "^3.0.5",
"moment": "^2.29.1",
"react": "17.0.2",
"react-native": "0.66.4",
"react-native-barcode-builder": "^2.0.0",
"react-native-camera": "^4.2.1",
"react-native-collapsible": "^1.6.0",
"react-native-config": "^1.4.11",
"react-native-dots-pagination": "^0.2.0",
"react-native-flash-message": "^0.2.0",
"react-native-floating-action": "^1.22.0",
"react-native-geolocation-service": "^5.3.0-beta.4",
"react-native-gesture-handler": "^2.0.0",
"react-native-gradient-buttons": "^2.0.2",
"react-native-html-to-pdf": "^0.12.0",
"react-native-hyperlink": "^0.0.19",
"react-native-image-pan-zoom": "^2.1.12",
"react-native-linear-gradient": "^2.5.6",
"react-native-marquee": "^0.3.2",
"react-native-material-menu": "^2.0.0",
"react-native-modal": "^13.0.1",
"react-native-open-maps": "^0.4.0",
"react-native-pager-view": "^5.4.9",
"react-native-permissions": "^3.2.0",
"react-native-phone-number-input": "^2.1.0",
"react-native-qrcode-scanner": "^1.5.4",
"react-native-qrcode-svg": "^6.1.2",
"react-native-reanimated": "^2.2.4",
"react-native-render-html": "^6.3.1",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.0",
"react-native-share": "^7.3.5",
"react-native-splash-screen": "^3.3.0",
"react-native-sqlite-storage": "^6.0.1",
"react-native-svg": "^12.1.1",
"react-native-unimodules": "^0.14.10",
"react-native-uuid": "^2.0.1",
"react-native-viewpager": "^0.2.13",
"react-native-wallet": "^1.0.8",
"react-native-webview": "^11.15.0",
"rn-fetch-blob": "^0.12.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}
What I have tried...
I think the commands which is necessary to solve the error I almost tried to solve...
And also I have set the environment setup very properly as the react native setup docs says ...
I have updated gradle version , kotlin version, react native version , npm version , node version etc...
I have also updated Firebase app , Firebase message and Firebase.. where Firebase app and messages version should be same...
I have also set up the SDK TOOLS, Android SDK in Android studio ...
I have uninstalled the nodes, vs code and again reinstalled it but again facing the same issue i.e. Build Failed....
Here is my android/build.gradle
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
kotlin_version = '1.7.0'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
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()
maven { url 'https://www.jitpack.io' }
}
}
In app/build.gradle already passes key under signing configs...
signingConfigs {
debug {
storeFile file('AppsDNA_production.keystore')
storePassword 'inficare#123'
keyAlias 'appsdna'
keyPassword 'inficare#123'
}
release {
storeFile file('AppsDNA_production.keystore')
storePassword 'inficare#123'
keyAlias 'appsdna'
keyPassword 'inficare#123'
}
}
PS D:\ememberProject\eMembership-React-Native> npm version
{
eMembershipCard: '0.0.4',
npm: '9.1.3',
node: '19.1.0',
v8: '10.7.193.20-node.19',
uv: '1.44.2',
zlib: '1.2.11',
brotli: '1.0.9',
ares: '1.18.1',
modules: '111',
nghttp2: '1.47.0',
napi: '8',
llhttp: '8.1.0',
openssl: '3.0.7+quic',
cldr: '42.0',
icu: '72.1',
tz: '2022e',
unicode: '15.0',
ngtcp2: '0.8.1',
nghttp3: '0.7.0'
}
try this package version
"react-native-screens": "3.7.2",
This is an error I'm facing
Package.json
"dependencies": {
"#react-native-async-storage/async-storage": "^1.16.0",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-community/netinfo": "^7.1.5",
"#react-native-firebase/app": "^14.12.0",
"#react-native-firebase/messaging": "^14.2.2",
"#react-navigation/drawer": "^6.1.8",
"#react-navigation/native": "^6.0.6",
"#react-navigation/stack": "^6.0.11",
"android": "^0.0.8",
"axios": "^0.24.0",
"linkify-html": "^3.0.5",
"moment": "^2.29.1",
"react": "17.0.2",
"react-native": "0.66.4",
"react-native-barcode-builder": "^2.0.0",
"react-native-camera": "^4.2.1",
"react-native-collapsible": "^1.6.0",
"react-native-config": "^1.4.11",
"react-native-dots-pagination": "^0.2.0",
"react-native-flash-message": "^0.2.0",
"react-native-floating-action": "^1.22.0",
"react-native-geolocation-service": "^5.3.0-beta.4",
"react-native-gesture-handler": "^2.0.0",
"react-native-gradient-buttons": "^2.0.2",
"react-native-html-to-pdf": "^0.12.0",
"react-native-hyperlink": "^0.0.19",
"react-native-image-pan-zoom": "^2.1.12",
"react-native-linear-gradient": "^2.5.6",
"react-native-marquee": "^0.3.2",
"react-native-material-menu": "^2.0.0",
"react-native-modal": "^13.0.1",
"react-native-open-maps": "^0.4.0",
"react-native-pager-view": "^5.4.9",
"react-native-permissions": "^3.2.0",
"react-native-phone-number-input": "^2.1.0",
"react-native-qrcode-scanner": "^1.5.4",
"react-native-qrcode-svg": "^6.1.2",
"react-native-reanimated": "^2.2.4",
"react-native-render-html": "^6.3.1",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.0",
"react-native-share": "^7.3.5",
"react-native-splash-screen": "^3.3.0",
"react-native-sqlite-storage": "^6.0.1",
"react-native-svg": "^12.1.1",
"react-native-unimodules": "^0.14.10",
"react-native-uuid": "^2.0.1",
"react-native-viewpager": "^0.2.13",
"react-native-wallet": "^1.0.8",
"react-native-webview": "^11.15.0",
"rn-fetch-blob": "^0.12.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}
android/build.gradle
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
configurations.all {
resolutionStrategy {
force "com.facebook.react:react-native:" + "0.66.5"
}
}
repositories {
mavenCentral()
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()
maven { url 'https://www.jitpack.io' }
maven { url "https://maven.google.com" }
}
}
android/app/build.gradle
dependencies {
implementation project(':react-native-html-to-pdf')
implementation project(':react-native-share')
implementation project(':react-native-sqlite-storage')
implementation 'com.android.support:multidex:2.0.1'
implementation project(':react-native-art')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+"
implementation project(':react-native-pager-view')
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.implementation
into 'libs'
}
apply from: file("../../node_modules/#react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
What I have tried...
I think the commands which is necessary to solve the error I almost tried to solve...
And also I have set the environment setup very properly as the react native setup docs says ...
I have updated gradle version , kotlin version, react native version , npm version , node version etc...
I have also updated Firebase app , Firebase message and Firebase.. where Firebase app and messages version should be same...
I have also set up the SDK TOOLS, Android SDK in Android studio ...
I have uninstalled the nodes, vs code and again reinstalled it but again facing the same issue i.e. Build Failed....
There are multiple options you can try.
There are chances that your application is not getting enough space to get installed on emulator.
Create new emulator in that under Verify Configuration click on Show Advance Settings and modify Memory and Storage block as shown below and now try running your application in newly created emulator.
Open your project into android studio and try running application from android studio and not using command line
Let me know doest it helpful to you or not.
I tried cloning and building this project,
build.gradle:
Error :
The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher.
The following dependencies do not satisfy the required version:
project ':expo' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.7.20'
ext {
buildToolsVersion = "30.0.3"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
kotlin_version = "1.7.20"
}
repositories {
google()
mavenCentral()
//gradlePluginPortal()
//jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath ("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
// 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(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../android"))
}
maven {
// Android JSC is installed from npm
url(new File(["node", "--print", "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), "../dist"))
}
google()
mavenCentral()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
"dependencies": {
"#config-plugins/react-native-ble-plx": "^3.0.0",
"#daniel-faber/json-ts": "^0.6.0",
"#react-native-async-storage/async-storage": "~1.17.3",
"#react-native-community/netinfo": "9.3.0",
"#react-native-masked-view/masked-view": "0.2.7",
"#react-navigation/bottom-tabs": "^6.2.0",
"#react-navigation/drawer": "^6.1.8",
"#react-navigation/native": "^6.0.6",
"#react-navigation/stack": "^6.2.1",
"apollo-client": "^2.6.10",
"axios": "^1.1.3",
"expo": "^46.0.0",
"expo-app-loading": "~2.1.0",
"expo-application": "~4.2.2",
"expo-barcode-scanner": "~11.4.0",
"expo-constants": "~13.2.4",
"expo-dev-client": "~1.3.1",
"expo-font": "~10.2.0",
"expo-image-picker": "~13.3.1",
"expo-localization": "~13.1.0",
"expo-network": "~4.3.0",
"expo-splash-screen": "~0.16.2",
"expo-status-bar": "~1.4.0",
"i18next": "^22.0.4",
"js-joda": "^1.11.0",
"lodash": "^4.17.21",
"mipher": "^1.1.5",
"moment": "^2.29.3",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-editable-label": "^1.3.2",
"react-floating-button": "^1.1.1",
"react-i18next": "^12.0.0",
"react-native": "^0.69.5",
"react-native-ble-plx": "^2.0.3",
"react-native-camera": "^4.2.1",
"react-native-circular-action-menu": "^0.5.0",
"react-native-confirm-dialog": "^0.1.0",
"react-native-dash": "^0.0.11",
"react-native-dialog-input": "^1.0.8",
"react-native-flatlist-slider": "^1.0.6",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "~2.5.0",
"react-native-loading-spinner-overlay": "^3.0.1",
"react-native-nfc-manager": "^3.11.5",
"react-native-paper": "^5.0.0-rc.3",
"react-native-paper-dropdown": "^1.0.7",
"react-native-popup-menu": "^0.16.1",
"react-native-qrcode-scanner": "^1.6.0",
"react-native-reanimated": "^2.2.2",
"react-native-root-toast": "^3.3.0",
"react-native-safe-area-context": "4.3.1",
"react-native-screens": "~3.15.0",
"react-native-simple-dialogs": "^1.5.0",
"react-native-uuid": "^2.0.1",
"react-native-vector-icons": "^9.2.0",
"react-native-web": "~0.18.7",
"react-redux": "8.0.5",
"reactotron-react-native": "^5.0.3",
"redux": "^4.2.0",
"redux-thunk": "^2.4.1",
"rxjs": "^7.5.5",
"use-debounce": "8.0.4"
},
I tried to download ext.kotlin_version = '1.7.20' but it never worked
When i start de app in my real device, the app crash (stopped working) before the splash screen. I release all architecture APKs, and i tested all of then in my device, no ones work. I'm using Hermes, Expo libs (i already setup for unimodules), and before eject the project, i already tested in Expo app and everything works perfectly!
My env:
System:
OS: Windows 8.1 6.3.9600
CPU: (4) x64 Intel(R) Pentium(R) CPU G4560 # 3.50GHz
Memory: 4.70 GB / 7.96 GB
Binaries:
Node: 12.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.21.1 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 27, 28
Build Tools: 27.0.3, 28.0.3
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: 1.8.0_231
Python: 2.7.17
npmPackages:
#react-native-community/cli: Not Found
react: ~16.11.0 => 16.11.0
react-native: ~0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
package.JSON:
{
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"postinstall": "jetify"
},
"dependencies": {
"expo": "~38.0.8",
"expo-splash-screen": "^0.5.0",
"expo-status-bar": "^1.0.2",
"expo-updates": "~0.2.10",
"react": "~16.11.0",
"react-dom": "~16.11.0",
"react-native": "~0.62.2",
"react-native-gesture-handler": "1.6.1",
"react-native-reanimated": "1.8.0",
"react-native-screens": "2.7.0",
"react-native-unimodules": "~0.10.1",
"react-native-web": "~0.11.7",
"#react-native-community/masked-view": "0.1.10",
"#react-native-community/netinfo": "5.9.0",
"#react-native-community/viewpager": "^4.1.4",
"expo-camera": "^8.3.1",
"expo-document-picker": "^8.3.0",
"expo-file-system": "^9.1.0",
"expo-image-manipulator": "^8.2.1",
"expo-image-picker": "^8.4.0",
"expo-intent-launcher": "^8.2.1",
"expo-permissions": "^9.1.0",
"firebase": "^7.17.2",
"react-native-animatable": "^1.3.3",
"react-native-material-ripple": "^0.9.1",
"react-native-modal": "^11.5.6",
"react-native-paper": "^4.0.1",
"react-native-progress-circle": "^2.1.0",
"react-native-safe-area-context": "1.0.2",
"react-native-vector-icons": "^7.0.0",
"react-navigation": "4.2.2",
"react-navigation-drawer": "^2.5.0",
"react-navigation-stack": "^2.8.2",
"react-navigation-tabs": "^2.9.0",
"react-redux": "^7.2.1",
"redux": "^4.0.5"
},
"devDependencies": {
"#babel/core": "^7.8.6",
"babel-jest": "~25.2.6",
"jest": "~25.2.6",
"react-test-renderer": "~16.11.0",
"babel-preset-expo": "~8.1.0"
},
"private": true
}
build.gradle(android/app):
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
enableHermes: true
]
apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/expo-updates/scripts/create-manifest-android.gradle"
def enableSeparateBuildPerCPUArchitecture = true
def enableProguardInReleaseBuilds = false
def jscFlavor = 'org.webkit:android-jsc:+'
def enableHermes = project.ext.react.get("enableHermes", true);
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.bookep"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk true // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
signingConfigs {
debug {
storeFile file('my-release-key.keystore')
storePassword '******'
keyAlias 'my-key-alias'
keyPassword '*****'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
packagingOptions {
pickFirst "lib/armeabi-v7a/libc++_shared.so"
pickFirst "lib/arm64-v8a/libc++_shared.so"
pickFirst "lib/x86/libc++_shared.so"
pickFirst "lib/x86_64/libc++_shared.so"
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://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
}
}
}
dexOptions {
javaMaxHeapSize "3g"
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
addUnimodulesDependencies()
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: file("../../node_modules/#react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
I already fix this problem, using registerRootComponent from Expo in index.js file.
I am using react-native-maps to show Mapview in my page ,unfortunetely it's working in Iphone but not shown Mapview in android, it only shown logo , and yes I folllowed all the configuration steps as they mention in documentation.
Install react-native-maps using:
npm install react-native-maps --save
Link maps:
react-native link react-native-maps
Check react-native-maps project in android/settings.gradle:
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
Check an dependency of your app in android/app/build.gradle:
dependencies {
...
compile project(':react-native-maps')
...
}
Check android/build.gradle:
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
googlePlayServicesVersion = "11.8.0"
androidMapsUtilsVersion = "0.5+"
}
Specify your Google Maps API Key in android/app/src/main/AndroidManifest.xml:
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="MY API KEY"/>
This is my package.json file dependencies
"dependencies": {
"accordion-collapse-react-native": "^0.1.6",
"buffer": "^5.2.1",
"react": "16.6.0-alpha.8af6728",
"react-native": "0.57.3",
"react-native-calendars": "^1.21.0",
"react-native-check-box": "^2.1.5",
"react-native-chooser": "^1.7.0",
"react-native-datepicker": "^1.7.2",
"react-native-map-link": "^2.1.6",
"react-native-maps": "^0.23.0",
"react-native-maps-directions": "^1.6.0",
"react-native-modal-datetime-picker": "^6.0.0",
"react-native-modal-dropdown": "^0.6.2",
"react-native-photo-upload": "^1.3.0",
"react-native-popover-tooltip": "^1.1.4",
"react-native-popup-dialog": "^0.15.1",
"react-native-rating": "^2.0.4",
"react-native-searchable-dropdown": "^1.0.5",
"react-native-side-menu": "^1.1.3",
"react-native-vector-icons": "^6.0.2",
"react-navigation": "^2.12.0"
},
Use this in the meta data tag instead of v2:
android:name="com.google.android.geo.API_KEY"