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 и переустановленные зависимости
Код: Выделить всё
rm -rf node_modules package-lock.json
npm install
Код: Выделить всё
cd android
rm -rf .gradle
./gradlew clean
./gradlew --refresh-dependencies
cd ..
Код: Выделить всё
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>
подтвержденное приложение /build.gradle < /code> включает в себя зависимость < /strong>
< /strong>
=18"
}
}
< /code>
теги: < /strong> < /h3>
react-nativeПодробнее здесь: https://stackoverflow.com/questions/794 ... act-androi