React Native Expo Project не создает Android с модулем Adact-Google-Mobile-ADSAndroid

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 React Native Expo Project не создает Android с модулем Adact-Google-Mobile-ADS

Сообщение Anonymous »

Итак, у меня есть этот проект Native Expo React, который я клонировал из своего собственного репозитория от GitHub. Как только я клонировал проект и попытался построить его с помощью

Код: Выделить всё

npx eas-cli build --profile development --platform android< /code>
это не работает, и это дает мне эту ошибку: < /p>
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>
Вот мое app.json: < /p>
{
"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>
И вот мой пакет.json: < /p>
{
"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
}

Я попытался посмотреть на некоторые другие вопросы Stackoverflow, они предложили изменить версию Kotlin на 1.8.22, я сделал, но это не сработало.
Чтобы изменить версию Kotlin, я изменил файл build.gradle с этого: < /p>
// 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>
до этого: < /p>
// 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>
Если вам нужна другая информация, пожалуйста, скажите мне.
заранее спасибо < /p>

Подробнее здесь: https://stackoverflow.com/questions/789 ... e-mobile-a
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Android»