So I have this react native expo project that I cloned from my own repository from github. Once I cloned the project and tried to build it with
npx eas-cli build --profile development --platform android
It does not work, and it gives me this error:
<code>FAILURE: Build failed with an exception.
Execution failed for task ':react-native-google-mobile-ads:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
> 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.
<code>FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-google-mobile-ads:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* 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 3m 57s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
</code>
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-google-mobile-ads:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* 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 3m 57s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
Here is my app.json:
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"image": "./assets/splash.png",
"backgroundColor": "#ffffff"
"android.permission.SCHEDULE_EXACT_ALARM",
"foregroundImage": "./assets/icon.png",
"backgroundColor": "#ffffff"
"package": "com.mirceagodiac.timepal"
"favicon": "./assets/favicon.png"
"projectId": "xxxxxxxxxxxxxxxxxx"
"react-native-google-mobile-ads": {
"android_app_id": "ca-app-pub-xxxxxxxxxxxxxxxxxx",
"ios_app_id": "ca-app-pub-xxxxxxxxxxxxxxxxxx"
<code>{
"expo": {
"name": "Timepal",
"slug": "TimePal",
"version": "1.2.1",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"**/*"
],
"android": {
"permissions": [
"android.permission.SCHEDULE_EXACT_ALARM",
"POST_NOTIFICATIONS"
],
"adaptiveIcon": {
"foregroundImage": "./assets/icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.mirceagodiac.timepal"
},
"web": {
"favicon": "./assets/favicon.png"
},
"extra": {
"eas": {
"projectId": "xxxxxxxxxxxxxxxxxx"
}
},
"owner": "mariusdarius"
},
"react-native-google-mobile-ads": {
"android_app_id": "ca-app-pub-xxxxxxxxxxxxxxxxxx",
"ios_app_id": "ca-app-pub-xxxxxxxxxxxxxxxxxx"
}
}
</code>
{
"expo": {
"name": "Timepal",
"slug": "TimePal",
"version": "1.2.1",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"**/*"
],
"android": {
"permissions": [
"android.permission.SCHEDULE_EXACT_ALARM",
"POST_NOTIFICATIONS"
],
"adaptiveIcon": {
"foregroundImage": "./assets/icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.mirceagodiac.timepal"
},
"web": {
"favicon": "./assets/favicon.png"
},
"extra": {
"eas": {
"projectId": "xxxxxxxxxxxxxxxxxx"
}
},
"owner": "mariusdarius"
},
"react-native-google-mobile-ads": {
"android_app_id": "ca-app-pub-xxxxxxxxxxxxxxxxxx",
"ios_app_id": "ca-app-pub-xxxxxxxxxxxxxxxxxx"
}
}
And here is my package.json:
"main": "node_modules/expo/AppEntry.js",
"android": "expo run:android",
"web": "expo start --web"
"@preact/signals-react": "^1.3.6",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/datetimepicker": "8.0.1",
"@react-native-masked-view/masked-view": "0.3.1",
"@react-navigation/bottom-tabs": "^6.5.11",
"@react-navigation/material-bottom-tabs": "^6.2.19",
"@react-navigation/native": "^6.1.8",
"@react-navigation/native-stack": "^6.9.14",
"@react-navigation/stack": "^6.3.20",
"@uiball/loaders": "^1.3.0",
"expo-constants": "~16.0.2",
"expo-contacts": "~13.0.5",
"expo-dev-client": "~4.0.26",
"expo-linear-gradient": "~13.0.2",
"expo-notifications": "^0.28.16",
"expo-splash-screen": "^0.27.5",
"expo-sqlite": "~14.0.6",
"expo-status-bar": "~1.12.1",
"location-picker": "^1.1.1",
"moment-precise-range-plugin": "^1.3.0",
"react-native": "0.74.5",
"react-native-actions-sheet": "^0.9.0-alpha.24",
"react-native-calendars": "^1.1301.0",
"react-native-dropdown-select-list": "^2.0.5",
"react-native-event-listeners": "^1.0.7",
"react-native-gesture-handler": "~2.16.1",
"react-native-google-mobile-ads": "^12.11.0",
"react-native-gradients": "^2.0.1",
"react-native-linear-gradient": "^2.8.3",
"react-native-loading-spinner-overlay": "^3.0.1",
"react-native-multiple-select": "^0.5.12",
"react-native-paper": "^5.11.4",
"react-native-place-picker": "^2.7.0",
"react-native-push-notification": "^8.1.1",
"react-native-reanimated": "~3.10.1",
"react-native-responsive-fontsize": "^0.5.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-select-contact": "^1.6.3",
"react-native-select-dropdown": "^3.4.0",
"react-native-svg": "15.2.0",
"react-native-timer-picker": "^1.5.0",
"react-native-vector-icons": "^10.0.3",
"react-navigation": "^5.0.0"
"@babel/core": "^7.24.0",
"@types/luxon": "^3.4.1",
"@types/react": "~18.2.79",
<code>{
"name": "timepal",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"@preact/signals-react": "^1.3.6",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/datetimepicker": "8.0.1",
"@react-native-masked-view/masked-view": "0.3.1",
"@react-navigation/bottom-tabs": "^6.5.11",
"@react-navigation/material-bottom-tabs": "^6.2.19",
"@react-navigation/native": "^6.1.8",
"@react-navigation/native-stack": "^6.9.14",
"@react-navigation/stack": "^6.3.20",
"@uiball/loaders": "^1.3.0",
"expo": "^51.0.32",
"expo-constants": "~16.0.2",
"expo-contacts": "~13.0.5",
"expo-dev-client": "~4.0.26",
"expo-device": "~6.0.2",
"expo-linear-gradient": "~13.0.2",
"expo-notifications": "^0.28.16",
"expo-splash-screen": "^0.27.5",
"expo-sqlite": "~14.0.6",
"expo-status-bar": "~1.12.1",
"fix": "^0.0.3",
"location-picker": "^1.1.1",
"luxon": "^3.4.4",
"moment": "^2.30.1",
"moment-precise-range-plugin": "^1.3.0",
"react": "18.2.0",
"react-native": "0.74.5",
"react-native-actions-sheet": "^0.9.0-alpha.24",
"react-native-calendars": "^1.1301.0",
"react-native-dropdown-select-list": "^2.0.5",
"react-native-event-listeners": "^1.0.7",
"react-native-gesture-handler": "~2.16.1",
"react-native-google-mobile-ads": "^12.11.0",
"react-native-gradients": "^2.0.1",
"react-native-linear-gradient": "^2.8.3",
"react-native-loading-spinner-overlay": "^3.0.1",
"react-native-multiple-select": "^0.5.12",
"react-native-paper": "^5.11.4",
"react-native-place-picker": "^2.7.0",
"react-native-push-notification": "^8.1.1",
"react-native-reanimated": "~3.10.1",
"react-native-responsive-fontsize": "^0.5.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-select-contact": "^1.6.3",
"react-native-select-dropdown": "^3.4.0",
"react-native-svg": "15.2.0",
"react-native-timer-picker": "^1.5.0",
"react-native-vector-icons": "^10.0.3",
"react-navigation": "^5.0.0"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@types/luxon": "^3.4.1",
"@types/react": "~18.2.79",
"typescript": "~5.3.3"
},
"private": true
}
</code>
{
"name": "timepal",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"@preact/signals-react": "^1.3.6",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/datetimepicker": "8.0.1",
"@react-native-masked-view/masked-view": "0.3.1",
"@react-navigation/bottom-tabs": "^6.5.11",
"@react-navigation/material-bottom-tabs": "^6.2.19",
"@react-navigation/native": "^6.1.8",
"@react-navigation/native-stack": "^6.9.14",
"@react-navigation/stack": "^6.3.20",
"@uiball/loaders": "^1.3.0",
"expo": "^51.0.32",
"expo-constants": "~16.0.2",
"expo-contacts": "~13.0.5",
"expo-dev-client": "~4.0.26",
"expo-device": "~6.0.2",
"expo-linear-gradient": "~13.0.2",
"expo-notifications": "^0.28.16",
"expo-splash-screen": "^0.27.5",
"expo-sqlite": "~14.0.6",
"expo-status-bar": "~1.12.1",
"fix": "^0.0.3",
"location-picker": "^1.1.1",
"luxon": "^3.4.4",
"moment": "^2.30.1",
"moment-precise-range-plugin": "^1.3.0",
"react": "18.2.0",
"react-native": "0.74.5",
"react-native-actions-sheet": "^0.9.0-alpha.24",
"react-native-calendars": "^1.1301.0",
"react-native-dropdown-select-list": "^2.0.5",
"react-native-event-listeners": "^1.0.7",
"react-native-gesture-handler": "~2.16.1",
"react-native-google-mobile-ads": "^12.11.0",
"react-native-gradients": "^2.0.1",
"react-native-linear-gradient": "^2.8.3",
"react-native-loading-spinner-overlay": "^3.0.1",
"react-native-multiple-select": "^0.5.12",
"react-native-paper": "^5.11.4",
"react-native-place-picker": "^2.7.0",
"react-native-push-notification": "^8.1.1",
"react-native-reanimated": "~3.10.1",
"react-native-responsive-fontsize": "^0.5.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-select-contact": "^1.6.3",
"react-native-select-dropdown": "^3.4.0",
"react-native-svg": "15.2.0",
"react-native-timer-picker": "^1.5.0",
"react-native-vector-icons": "^10.0.3",
"react-navigation": "^5.0.0"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@types/luxon": "^3.4.1",
"@types/react": "~18.2.79",
"typescript": "~5.3.3"
},
"private": true
}
I tried to look around on some other stackoverflow questions, they suggested to change the kotlin version to 1.8.22, I did, but it didn’t work.
To change the kotlin version, I changed the build.gradle file from this:
<code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.23'
ndkVersion = "26.1.10909125"
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"
// 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'))
// 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'))
maven { url 'https://www.jitpack.io' }
<code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.23'
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' }
}
}
</code>
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.23'
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' }
}
}
To this:
<code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
ndkVersion = "26.1.10909125"
classpath('com.android.tools.build:gradle')
classpath('com.facebook.react:react-native-gradle-plugin')
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion', '1.8.22')}"
apply plugin: "com.facebook.react.rootproject"
// 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'))
// 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'))
maven { url 'https://www.jitpack.io' }
<code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
kotlinVersion = '1.8.22'
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')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion', '1.8.22')}"
}
}
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' }
}
}
</code>
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
kotlinVersion = '1.8.22'
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')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion', '1.8.22')}"
}
}
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' }
}
}
If you need any other info, please tell me.
Thanks in advance