React Native Android Build стерж с помощью «плагина, не найденного» после понижения Gradle для Vision CameraAndroid

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 React Native Android Build стерж с помощью «плагина, не найденного» после понижения Gradle для Vision Camera

Сообщение Anonymous »

Я пытаюсь добавить сканер штрих -кода в свой нативный проект React и столкнулся с серией каскадных ошибок нативного сборки на Android. Я решил несколько вопросов, но теперь застрял в последнем.
Моя цель-использовать реагируемое камеру < /code> с плагином сканирования штрих-кода.
Текущая проблема:
После выравнивания всех моих версий упаковки и понижения версии моей грады, сборка сейчас не сбои в сфотографии конфигурации с ошибкой: < /p>
FAILURE: Build failed with an exception.
< /code>
  • Где: < /li>
    < /ul>
    Файл настроек 'C:\PEA\android\settings.gradle' line: 2< /code> < /p>

    Что пошло не так:
    Plugin [id: 'com.facebook.react.settings'] was not found in any of the following sources:
  • Gradle Core Plugins (plugin is not in org.gradle namespace)
  • Plugin Repositories (plugin dependency must include a version number for this source)
Устранение неполадок, предпринятые < /h2>
Эта ошибка является результатом длительного процесса отладки. Вот что я сделал до сих пор: < /p>

[*] Первоначальная попытка: я сначала попытался использовать пакет Vision-camera-code-code-scanner, но обнаружил, что его хранилище Github было архивировано и теперь только чтение, что делает его непривлекательным для этого проекта. Vision-camera-v3-barcode-scanner. < /li>
Выравнивание зависимости: это привело к серии ошибок несовместимости версий. Чтобы решить их, я имею:
o выровнял мой Package.json для использования REACT Native 0.73.6 и совместимых версий реагируемого по-видимого висионного камеры (~ 3.9.2), реактивных работников (~ 0.4.0) и реактивных, изреанимированных (~ 3.6.2) < /code>. (VisionCamera_EnableCodescanner = true).
[*] Ошибка новой архитектуры: после выравнивания пакетов я столкнулся с ошибкой сборки C ++/Cmake, связанной с новой архитектурой Native React. Я решил это, установив newarchenabled = false в android/gradle.properties.
Ошибка версии Gradle Gradle: следующая сборка не удалась с ошибкой Gradle (неразрешенная ссылка: ServiceOf), что указывает на несовместимость между плагином Native Gradle Gradle и моей версией Gradle (8.14.1). Я решил это, понизив версию моего проекта до 8.3 в Android/Gradle/warper/gradle-wrapper.properties.
Это привело меня к текущей ошибке, где Gradle 8.3, кажется, нуждается в более явном определении для плагина Com.facebook.react.settings . Я правильно настраиваю свой файл настройки. "dependencies": {
"@react-native-async-storage/async-storage": "^2.2.0",
"@react-native-picker/picker": "^2.11.1",
"@react-navigation/native": "^7.1.14",
"@react-navigation/native-stack": "^7.3.21",
"axios": "^1.10.0",
"multer": "^2.0.1",
"react": "19.1.0",
"react-native": "0.80.0",
"react-native-get-random-values": "^1.11.0",
"react-native-image-picker": "^8.2.1",
"react-native-logs": "^5.3.0",
"react-native-safe-area-context": "^5.5.0",
"react-native-screens": "^4.11.1",
"react-native-sqlite-storage": "^6.0.1",
"uuid": "^11.1.0"
},

android/build.gradle:
buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 35
ndkVersion = "27.1.12297006"
kotlinVersion = "2.1.20"
}
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")
}
}

Применить плагин: "com.facebook.react.rootproject"
android/app/build.gradle:образной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-communi ... .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)
*/
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'

android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion

namespace "com.pea"
defaultConfig {
applicationId "com.pea"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}

// FIX: The `release` config is now correctly placed inside the single `signingConfigs` block.
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}

// FIX: The `release` signingConfig is now correctly set inside the single `buildTypes` block.
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}

// Your Java 17 compatibility options are correctly placed here.
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}
}

dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}

android/settings.gradle:
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = 'PEA'
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')


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

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

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

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

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

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

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