Title:
React Native Release Build Fails: Could not find com.facebook.react:react-android:0.76.7 Description:
I am working on a React Native project, И сборка отладка работает нормально . Однако, когда я пытаюсь генерировать release build с использованием:
cd android && ./gradlew assembleRelease
< /code>
он не удается со следующей ошибкой: < /p>
* Exception is:
org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':app:lintVitalReportRelease'.
at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:70)
at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48)
Caused by: org.gradle.api.internal.artifacts.ivyservice.TypedResolveException: Could not resolve all dependencies for configuration ':app:releaseCompileClasspath'.
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.facebook.react:react-android:0.76.7.
Required by:
project :app
Что я пробовал:
[*] обеспечить правильную реакцию нативную зависимость в package.json
"dependencies": {
"react-native": "0.76.7"
}
[*] deleted node_modules и переустановленные зависимости
buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
}
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")
}
}
allprojects {
repositories {
exclusiveContent {
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
// ...
}
}
apply plugin: "com.facebook.react.rootproject"
< /code>
< /li>
< /ol>
app /build.apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '../..'
// root = file("../../")
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
// reactNativeDir = file("../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
// codegenDir = file("../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
// cliFile = file("../../node_modules/react-native/cli.js")
/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]
/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []
/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
/* Autolinking */
autolinkLibrariesWithApp()
}
/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
android {
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libjsc.so'
pickFirst 'lib/arm64-v8a/libjsc.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
namespace "com.lmsapp"
defaultConfig {
applicationId "com.lmsapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
}
}
debug {
storeFile file('new_keystore.jks')
storePassword 'kts@29'
keyAlias 'androiddebugkey'
keyPassword 'kts@29'
}
}
buildTypes {
debug {
// signingConfig signingConfigs.release
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
}
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation project(':react-native-fs')
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
< /code>
< /li>
< /ol>
my package.json < /code> файл: < /strong> < /h3>
{
"name": "lmsApp",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest",
"postinstall": "npx typesync"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^2.1.1",
"@react-native-google-signin/google-signin": "^13.1.0",
"@react-navigation/bottom-tabs": "^7.2.0",
"@react-navigation/drawer": "^7.1.1",
"@react-navigation/native": "^7.0.14",
"@react-navigation/stack": "^7.1.1",
"@tanstack/react-query": "^5.64.2",
"axios": "^1.7.9",
"hermes-engine": "^0.11.0",
"lottie-react-native": "^7.2.1",
"react": "18.3.1",
"react-native": "0.76.7",
"react-native-animatable": "^1.4.0",
"react-native-blob-util": "^0.21.2",
"react-native-dotenv": "^3.4.11",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.22.0",
"react-native-get-random-values": "^1.11.0",
"react-native-image-picker": "^8.2.0",
"react-native-orientation-locker": "^1.7.0",
"react-native-pdf": "^6.7.6",
"react-native-reanimated": "^3.16.6",
"react-native-reanimated-carousel": "^3.5.1",
"react-native-safe-area-context": "^5.0.0",
"react-native-screens": "^4.4.0",
"react-native-share": "^12.0.3",
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "^15.11.1",
"react-native-svg-charts": "^5.4.0",
"react-native-system-navigation-bar": "^2.6.4",
"react-native-vector-icons": "^10.2.0",
"react-native-video": "^6.9.0",
"react-native-video-player": "^0.15.0-beta.3"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "15.0.1",
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native/babel-preset": "0.76.5",
"@react-native/eslint-config": "0.76.5",
"@react-native/metro-config": "0.76.5",
"@react-native/typescript-config": "0.76.5",
"@types/babel__core": "~7.20.5",
"@types/babel__preset-env": "~7.9.7",
"@types/eslint": "~9.6.1",
"@types/react": "^18.2.6",
"@types/react-native-dotenv": "~0.2.2",
"@types/react-native-get-random-values": "~1.8.2",
"@types/react-native-snap-carousel": "^3.8.11",
"@types/react-native-svg-charts": "~5.0.16",
"@types/react-native-vector-icons": "^6.4.18",
"@types/react-native-video-player": "~0.10.7",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.3.1",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}
< /code>
теги: < /strong> < /h3>
react-native
[b]Title:[/b] React Native Release Build Fails: Could not find com.facebook.react:react-android:0.76.7 [b]Description:[/b] I am working on a [b]React Native project[/b], И сборка [b] отладка работает нормально [/b]. Однако, когда я пытаюсь генерировать [b] release build [/b] с использованием: [code]cd android && ./gradlew assembleRelease < /code> он не удается со следующей ошибкой: < /p> * Exception is: org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':app:lintVitalReportRelease'. at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:70)
at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48) Caused by: org.gradle.api.internal.artifacts.ivyservice.TypedResolveException: Could not resolve all dependencies for configuration ':app:releaseCompileClasspath'.
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.facebook.react:react-android:0.76.7. Required by: project :app [/code] [b] Что я пробовал: [/b]
[*] [b] обеспечить правильную реакцию нативную зависимость в package.json [/b]
"dependencies": { "react-native": "0.76.7" }
[*] [b] deleted node_modules и переустановленные зависимости [/b] [code]rm -rf node_modules package-lock.json npm install [/code]
[*] [b] очищенный кэш градл и восстановил проект [/b] [code]cd android rm -rf .gradle ./gradlew clean ./gradlew --refresh-dependencies cd .. [/code]
/** * This is the configuration block to customize your React Native Android app. * By default you don't need to apply any configuration, just uncomment the lines you need. */ react { /* Folders */ // The root of your project, i.e. where "package.json" lives. Default is '../..' // root = file("../../") // The folder where the react-native NPM package is. Default is ../../node_modules/react-native // reactNativeDir = file("../../node_modules/react-native") // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen // codegenDir = file("../../node_modules/@react-native/codegen") // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js // cliFile = file("../../node_modules/react-native/cli.js")
/* Variants */ // The list of variants to that are debuggable. For those we're going to // skip the bundling of the JS bundle and the assets. By default is just 'debug'. // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. // debuggableVariants = ["liteDebug", "prodDebug"]
/* Bundling */ // A list containing the node command and its flags. Default is just 'node'. // nodeExecutableAndArgs = ["node"] // // The command to run when bundling. By default is 'bundle' // bundleCommand = "ram-bundle" // // The path to the CLI configuration file. Default is empty. // bundleConfig = file(../rn-cli.config.js) // // The name of the generated asset file containing your JS bundle // bundleAssetName = "MyApplication.android.bundle" // // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' // entryFile = file("../js/MyApplication.android.js") // // A list of extra flags to pass to the 'bundle' commands. // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle // extraPackagerArgs = []
/* Hermes Commands */ // The hermes compiler command to run. By default it is 'hermesc' // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" // // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"]
/* Autolinking */ autolinkLibrariesWithApp() }
/** * Set this to true to Run Proguard on Release builds to minify the Java bytecode. */ def enableProguardInReleaseBuilds = false
/** * The preferred build flavor of JavaScriptCore (JSC) * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ def jscFlavor = 'org.webkit:android-jsc:+'
dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") implementation project(':react-native-fs')
Title:
React Native Release Build Fails: Could not find com.facebook.react:react-android:0.76.7
Description:
I am working on a React Native project , И сборка отладка работает нормально . Однако, когда я пытаюсь генерировать release build с...
Я пытаюсь создать нативный проект React с поддержкой iOS с использованием действий Github. Работа проходит во время строительства капсула FirebaseSharedSwift со следующими ошибками:...
Я пытаюсь создать нативный проект React с поддержкой iOS с использованием действий Github. Работа проходит во время строительства капсула FirebaseSharedSwift со следующими ошибками:...
Я обновляю свой нативный проект React с версии 0,73,6 до 0,77,2. После завершения обновления, моя сборка iOS не удается со следующей ошибкой в Appdelegate.swift:
No such module 'RNCConfig'
Проблема:
Gradle продолжает пытаться извлечь плагин из репозиториев удаленного Maven вместо использования локального плагина от node_modules/@react-cnative/gradle-plugin .
Вопрос:
просто исправить это. Я хочу просто «Sync Project с Gradle Files...