When I try to build my expo react native app using expo EAS services I get this error as follows,
Please consult deprecation warnings for more details.
426 actionable tasks: 426 executed
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:bundleReleaseJsAndAssets'.
[stderr] > Process 'command 'node'' finished with non-zero exit value 1
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 3m 8s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
my eas.json looks like this,
{
"cli": {
"version": ">= 2.4.1"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"android": {
"image": "ubuntu-18.04-jdk-11-ndk-r19c"
}
},
"preview": {
"distribution": "internal"
},
"production": {
"android": {
"buildType": "apk"
}
}
},
"submit": {
"production": {}
}
}
my app configuration is as follows,
minSdkVersion = '21'
buildToolsVersion = '31.0.0'
compileSdkVersion = '33'
targetSdkVersion = '33'
I'm trying to generate an apk here.
Can someone help, please
The real cause of the issue should be logged somewhere above
Related
I have resumed a project that I started a few months ago, an app that I am building in react native. The problem is that when going to compile it told me that I had to update to eas. I have updated and now when trying to do a build it tells me:
[stderr] FAILURE: Build completed with 2 failures.
[stderr] 1: Task failed with an exception.
[stderr] -----------
[stderr] * Where:
[stderr] Build file '/home/expo/workingdir/build/node_modules/#unimodules/core/android/build.gradle' line: 3
[stderr] * What went wrong:
[stderr] A problem occurred evaluating project ':unimodules-core'.
[stderr] > Plugin with id 'maven' not found.
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] 2: Task failed with an exception.
[stderr] -----------
[stderr] * What went wrong:
[stderr] A problem occurred configuring project ':expo'.
[stderr] >
[stderr] compileSdkVersion is not specified. Please add it to build.gradle
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] ==============================================================================
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 1m 43s
my code in build.gradle is the following (I've already changed the maven call to maven-publish but it's still the same):
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
group = 'org.unimodules'
version = '6.7.1'
buildscript {
// Simple helper that allows the root project to override versions declared by this library.
ext.safeExtGet = { prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:6.7.1'
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
}
}
//Upload android library to maven with javadoc and android sources
configurations {
deployerJars
}
//Creating sources with comments
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
//Put the androidSources and javadoc to the artifacts
artifacts {
archives androidSourcesJar
}
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
repository(url: mavenLocal().url)
}
}
}
android {
compileSdkVersion safeExtGet("compileSdkVersion", 30)
buildToolsVersion safeExtGet("buildToolsVersion", 30)
minSdkVersion safeExtGet("minSdkVersion", 21)
targetSdkVersion safeExtGet("targetSdkVersion", 21)
buildToolsVersion "30.0.1"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
compileSdkVersion 30
minSdkVersion safeExtGet("minSdkVersion", 21)
targetSdkVersion safeExtGet("targetSdkVersion", 30)
consumerProguardFiles 'proguard-rules.pro'
versionCode 20
versionName "7.1.2"
minSdkVersion 21
targetSdkVersion 30
buildToolsVersion "30.0.1"
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
}
Do you know how I can solve it? Thanks.
I'm trying to migrate to using eas-build from expo build. I created a simple eas.json and I'm stuck on fixing this (hopefully) last error.
I didn't have a .env file before moving to eas-build so I'm quite sure that's not the issue.
package.json snippet:
"expo": "^41.0.0",
"react": "17.0.2",
"react-native": "0.63.4",
And my eas.json:
{
"cli": {
"version": ">= 2.1.0"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal",
"android": {
"buildType": "apk"
}
},
"production": {}
},
"submit": {
"production": {}
}
}
The error I'm getting in the "run gradlew" step on Expo:
> Task :app:createReleaseExpoConfig FAILED
[stderr] node:internal/modules/cjs/loader:936
[stderr] throw err;
[stderr] ^
[stderr] Error: Cannot find module 'jsonfile/utils'
[stderr] Require stack:
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/configure-splash-screen/node_modules/fs-extra/lib/json/output-json.js
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/configure-splash-screen/node_modules/fs-extra/lib/json/index.js
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/configure-splash-screen/node_modules/fs-extra/lib/index.js
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/configure-splash-screen/build/ios/index.js
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/configure-splash-screen/build/index.js
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config-plugins/build/android/SplashScreen.js
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config-plugins/build/android/index.js
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config-plugins/build/index.js
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config/build/plugins/withConfigPlugins.js
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config/build/Config.js
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config/build/index.js
[stderr] - /home/expo/workingdir/build/node_modules/expo-constants/scripts/getAppConfig.js
[stderr] at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
[stderr] at Function.Module._load (node:internal/modules/cjs/loader:778:27)
[stderr] at Module.require (node:internal/modules/cjs/loader:1005:19)
[stderr] at require (node:internal/modules/cjs/helpers:102:18)
[stderr] at Object.<anonymous> (/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/configure-splash-screen/node_modules/fs-extra/lib/json/output-json.js:3:23)
[stderr] at Module._compile (node:internal/modules/cjs/loader:1101:14)
[stderr] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[stderr] at Module.load (node:internal/modules/cjs/loader:981:32)
[stderr] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[stderr] at Module.require (node:internal/modules/cjs/loader:1005:19) {
[stderr] code: 'MODULE_NOT_FOUND',
[stderr] requireStack: [
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/configure-splash-screen/node_modules/fs-extra/lib/json/output-json.js',
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/configure-splash-screen/node_modules/fs-extra/lib/json/index.js',
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/configure-splash-screen/node_modules/fs-extra/lib/index.js',
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/configure-splash-screen/build/ios/index.js',
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/configure-splash-screen/build/index.js',
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config-plugins/build/android/SplashScreen.js',
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config-plugins/build/android/index.js',
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config-plugins/build/index.js',
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config/build/plugins/withConfigPlugins.js',
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config/build/Config.js',
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/node_modules/#expo/config/build/index.js',
[stderr] '/home/expo/workingdir/build/node_modules/expo-constants/scripts/getAppConfig.js'
[stderr] ]
[stderr] }
> Task :unimodules-permissions-interface:packageReleaseResources
> Task :unimodules-image-loader-interface:packageReleaseResources
> Task :unimodules-react-native-adapter:packageReleaseResources
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:createReleaseExpoConfig'.
[stderr] > Process 'command 'node'' finished with non-zero exit value 1
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 2m 16s
Your expo SDK is deprecated (SDK 41), which can cause a lot of problems when building with eas.
A lot of times this issue is resolved by upgrading your SDK to a non-deprecated expo SDK version.
Follow the instructions on upgrading your SDK and run eas build -p android --profile development or eas build -p android --profile preview
Upgrading Expo SDK
I'm learning react native navigation from https://reactnavigation.org/docs/hello-react-navigation
This is my package.json:
{
"name": "ReactNativeNavigation",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/masked-view": "^0.1.10",
"#react-navigation/native": "^5.5.1",
"#react-navigation/stack": "^5.4.2",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-gesture-handler": "^1.6.1",
"react-native-reanimated": "^1.9.0",
"react-native-safe-area-context": "^3.0.2",
"react-native-screens": "^2.8.0"
},
"devDependencies": {
"#babel/core": "^7.10.2",
"#babel/runtime": "^7.10.2",
"#react-native-community/eslint-config": "^1.1.0",
"babel-jest": "^26.0.1",
"eslint": "^7.2.0",
"jest": "^26.0.1",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.11.0"
},
"jest": {
"preset": "react-native"
}
}
This is App.js:
Just copied the code
import * as React from 'react';
import { View, Text } from 'react-native';
import { NavigationContainer } from '#react-navigation/native';
import { createStackNavigator } from '#react-navigation/stack';
function HomeScreen() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
</View>
);
}
const Stack = createStackNavigator();
function App() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;
When I run "react-native run-android",it doesn't work properly.
The screenshots is:
enter image description here
And error info in command prompt is:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-screens'.
> Could not resolve all artifacts for configuration ':react-native-screens:classpath'.
> Could not resolve com.android.tools.build:gradle:3.3.1.
Required by:
project :react-native-screens
> Could not resolve com.android.tools.build:gradle:3.3.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'. Received status code 400 from server: Bad Request
> Could not resolve com.android.tools.build:gradle:3.3.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'. Received status code 400 from server: Bad Request
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 26s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-screens'.
> Could not resolve all artifacts for configuration ':react-native-screens:classpath'.
> Could not resolve com.android.tools.build:gradle:3.3.1.
Required by:
project :react-native-screens
> Could not resolve com.android.tools.build:gradle:3.3.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'. Received status code 400 from server: Bad Request
> Could not resolve com.android.tools.build:gradle:3.3.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'. Received status code 400 from server: Bad Request
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 26s
at makeError (E:\learn\ReactNative\ReactNativeNavigation\node_modules\execa\index.js:174:9)
at E:\learn\ReactNative\ReactNativeNavigation\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (E:\learn\ReactNative\ReactNativeNavigation\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (E:\learn\ReactNative\ReactNativeNavigation\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)
(I paste the code into "Code Snippet" in order to keep the code display normal,I used the stackovflow the first time)
What should I do to solve these problems?
In fact,the demo below is still not working:
import 'react-native-gesture-handler';
import * as React from 'react';
import { NavigationContainer } from '#react-navigation/native';
export default function App() {
return (
<NavigationContainer>{/* Rest of your app code */}</NavigationContainer>
);
}
When I comment out this line of code "import 'react-native-gesture-handler';"
It works!
I sincerely look forward to your help!
I run the project in android studio,but it display the error info
"Gradle project sync failed. Please fix your project and try again"
so I do the following:
1.click File->Invalidate Caches/Restart in android studio
2.edit C:\Users\your user name.gradle\gradle.properties
## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Mon Jun 08 10:57:14 GMT+08:00 2020
# systemProp.http.proxyHost=127.0.0.1
# systemProp.http.proxyPort=1080
# systemProp.https.proxyHost=127.0.0.1
# systemProp.https.proxyPort=1080
I Comment out the the last four lines codes;
3.wait the Gradle installed
4.close android studio
5.run:react-native run-andriod
the result is:
E:\learn\ReactNative\ReactNativeNavigation>react-native run-build
error Unrecognized command "run-build".
info Run "react-native --help" to see a list of all available commands.
E:\learn\ReactNative\ReactNativeNavigation>react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1103 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
> Task :app:processDebugResources FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
60 actionable tasks: 3 executed, 57 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Unable to delete directory 'E:\learn\ReactNative\ReactNativeNavigation\android\app\build\generated\not_namespaced_r_class_sources\debug\r\androidx\appcompat' after 10 attempts
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 23s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Unable to delete directory 'E:\learn\ReactNative\ReactNativeNavigation\android\app\build\generated\not_namespaced_r_class_sources\debug\r\androidx\appcompat' after 10 attempts
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 23s
at makeError (E:\learn\ReactNative\ReactNativeNavigation\node_modules\execa\index.js:174:9)
at E:\learn\ReactNative\ReactNativeNavigation\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (E:\learn\ReactNative\ReactNativeNavigation\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (E:\learn\ReactNative\ReactNativeNavigation\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)
E:\learn\ReactNative\ReactNativeNavigation>
Finally,I open a command prompt and input:
react-native start
It works!
I encountered a lot of other mistakes in the process of solving the problem like
"Couldn't delete E:\learn\ReactNative\ReactNativeNavigation\android\app\build\outputs\apk\debug\output.json"
So I delete the file ,but I think this operation is useless.
another error is
"Android Studio AVD - Emulator: Process finished with exit code 1"
and so on.
At last, I want to know what it did when "react-native start" run.
When should I run react-native start?
I was still confused after reading it.
Thanks for Ravi reply.
I hope my answer helps.
In my expo project I am getting below error -
Getting error -
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeProdMinSdkProdKernelReleaseResources'.
[stderr] > Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error:
check logs for details
[stderr] * Try:
[stderr] Run with
[stderr] --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 6m 45s
690 actionable tasks: 690 executed
Error: Process exited with non-zero code: 1
at ChildProcess.child.on (/app/node_modules/xdl/node_modules/#expo/spawn-async/build/spawnAsync.js:39:21)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:915:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
app.json
{
"expo":{
"name":"YYY",
"slug":"YYY",
"scheme":"yyy",
"sdkVersion":"31.0.0",
"icon":"./assets/icon.png",
"version":"1.0.0",
"platforms":[
"ios",
"android"
],
"orientation":"portrait",
"primaryColor":"#cccccc",
"packagerOpts":{
"assetExts":[
"ttf"
]
},
"android":{
"package":"com.xxyy.xxyy",
"splash":{
"backgroundColor":"#ffffff",
"ldpi":"./assets/splash.png",
"mdpi":"./assets/mdpi/splash.png",
"hdpi":"./assets/hdpi/splash.png",
"xhdpi":"./assets/xhdpi/splash.png",
"xxhdpi":"./assets/xxhdpi/splash.png",
"xxxhdpi":"./assets/xxxhdpi/splash.png",
"resizeMode":"cover"
}
},
"ios":{
"bundleIdentifier":"com.xxy.yyz",
"splash":{
"backgroundColor":"#ffffff",
"resizeMode":"cover",
"image":"./assets/ios/splash#2x.png",
"tabletImage":"./assets/ios/splash.png"
}
},
"androidStatusBarColor":"#334393",
"androidStatusBar":{
"barStyle":"light-content",
"backgroundColor":"#334393"
},
"description":""
}
}
I'm new to react-native and when I tried to integrate the react-native-maps with my react native app it's giving the following error.
FAILURE: Build failed with an exception.
* Where:
Settings file 'D:\React-Projects\Native\ReactNativeMaps\android\settings.gradle' line: 3
* What went wrong:
Could not compile settings file 'D:\React-Projects\Native\ReactNativeMaps\android\settings.gradle'.
> startup failed:
settings file 'D:\React-Projects\Native\ReactNativeMaps\android\settings.gradle': 3: unexpected char: '\' # line 3, column 111.
node_modules\react-native-maps\lib\andro
^
1 error
This is my build.gradle dependencies array.
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:12.0.0'
implementation 'com.google.android.gms:play-services-maps:12.0.0'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
}
And this is my settings.gradle file content.
rootProject.name = 'ReactNativeMaps'
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-maps\lib\android')
include ':app'
In case someone need to see the full error,
$ react-native run-android
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
FAILURE: Build failed with an exception.
* Where:
Settings file 'D:\React-Projects\Native\ReactNativeMaps\android\settings.gradle' line: 3
* What went wrong:
Could not compile settings file 'D:\React-Projects\Native\ReactNativeMaps\android\settings.gradle'.
> startup failed:
settings file 'D:\React-Projects\Native\ReactNativeMaps\android\settings.gradle': 3: unexpected char: '\' # line 3, column 111.
node_modules\react-native-maps\lib\andro
^
1 error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
Command failed: gradlew.bat installDebug
Error: Command failed: gradlew.bat installDebug
at checkExecSyncError (child_process.js:616:11)
at Object.execFileSync (child_process.js:634:13)
at runOnAllDevices (D:\React-Projects\Native\ReactNativeMaps\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)
at buildAndRun (D:\React-Projects\Native\ReactNativeMaps\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)
at isPackagerRunning.then.result (D:\React-Projects\Native\ReactNativeMaps\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)
at process._tickCallback (internal/process/next_tick.js:68:7)
I've installed the react-native-map also via following commands and link it also.
npm install --save react-native-maps
react-native link react-native-maps
And this is the package.json file.
{
"name": "ReactNativeMaps",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.6.3",
"react-native": "0.58.4",
"react-native-maps": "^0.23.0"
},
"devDependencies": {
"babel-core": "7.0.0-bridge.0",
"babel-jest": "24.1.0",
"jest": "24.1.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
What went wrong? Did I miss something?
In your package.json change the react-native-maps as follows:
"react-native-maps": "https://github.com/react-community/react-native-maps.git"
In settings.gradle make sure your line 3 is:
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
Check if this works.
I found the problem. The reason that the build is the API_KEY. I replace the api-key with new api key and its working now. As well as change the line
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
also