I am trying to create and run a custom expo react-native mobile app. Every time I create a new expo app with npx create-expo-app@latest, I always get the following error when using npx expo run:android;
FAILURE: Build failed with an exception.
- What went wrong:
Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’.
Cannot query the value of this provider because it has no value available.
Any information that can help remedy this would be greatly appreciated.
Thank you.
npx expo run:android
Error message:
› Building app…
Starting a Gradle Daemon, 8 incompatible Daemons could not be reused, use –status for details
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
- What went wrong:
Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’.
Cannot query the value of this provider because it has no value available.
- 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.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 33s
13 actionable tasks: 3 executed, 10 up-to-date
Error: C:ProjectsSpeakEasyandroidgradlew.bat app:assembleDebug -x lint -x test –configure-on-demand –build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a,armeabi-v7a exited with non-zero code: 1
Error: C:ProjectsSpeakEasyandroidgradlew.bat app:assembleDebug -x lint -x test –configure-on-demand –build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a,armeabi-v7a exited with non-zero code: 1
at ChildProcess.completionListener (C:ProjectsSpeakEasynode_modules@expospawn-asyncsrcspawnAsync.ts:67:13)
at Object.onceWrapper (node:events:634:26)
at ChildProcess.emit (node:events:519:28)
at ChildProcess.cp.emit (C:ProjectsSpeakEasynode_modulescross-spawnlibenoent.js:34:29)
at maybeClose (node:internal/child_process:1105:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
…
at spawnAsync (C:ProjectsSpeakEasynode_modules@expospawn-asyncsrcspawnAsync.ts:28:21)
at spawnGradleAsync (C:ProjectsSpeakEasynode_modules@expoclisrcstartplatformsandroidgradle.ts:134:28)
at assembleAsync (C:ProjectsSpeakEasynode_modules@expoclisrcstartplatformsandroidgradle.ts:83:16)
at runAndroidAsync (C:ProjectsSpeakEasynode_modules@expoclisrcrunandroidrunAndroidAsync.ts:48:24)
package.json
{
"name": "speakeasy",
"main": "expo-router/entry",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"reset-project": "node ./scripts/reset-project.js",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"test": "jest --watchAll",
"lint": "expo lint"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^14.0.2",
"@react-navigation/bottom-tabs": "^7.0.0",
"@react-navigation/native": "^7.0.0",
"expo": "~52.0.18",
"expo-blur": "~14.0.1",
"expo-constants": "~17.0.3",
"expo-font": "~13.0.1",
"expo-haptics": "~14.0.0",
"expo-linking": "~7.0.3",
"expo-router": "4.0.11",
"expo-splash-screen": "~0.29.18",
"expo-status-bar": "~2.0.0",
"expo-symbols": "~0.2.0",
"expo-system-ui": "~4.0.6",
"expo-web-browser": "~14.0.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-native": "0.76.5",
"react-native-gesture-handler": "~2.20.2",
"react-native-google-mobile-ads": "^14.7.0",
"react-native-reanimated": "~3.16.1",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "~4.1.0",
"react-native-web": "~0.19.13",
"react-native-webview": "13.12.5",
"expo-device": "~7.0.1"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@types/jest": "^29.5.12",
"@types/react": "~18.3.12",
"@types/react-test-renderer": "^18.3.0",
"jest": "^29.2.1",
"jest-expo": "~52.0.2",
"react-test-renderer": "18.3.1",
"typescript": "^5.3.3"
},
"private": true
}
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '35.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '35')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.24'
ndkVersion = "26.1.10909125"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle')
classpath('com.facebook.react:react-native-gradle-plugin')
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
}
}
apply plugin: "com.facebook.react.rootproject"
allprojects {
repositories {
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', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), '../dist'))
}
google()
mavenCentral()
maven { url 'https://www.jitpack.io' }
}
}
Cory Crawford is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.