Код: Выделить всё
dlopen failed: library "libreact_featureflagsjni.so" not foundКонтекст
Я обновляю свое приложение React Native с версии 0.72.8 до 0.77.0 и пытаюсь сделать нативный
Код: Выделить всё
.soПроцесс: com.example.app, PID: 8267 java.lang.UnsatisfiedLinkError: ошибка dlopen: библиотека "libreact_featureflagsjni.so" не найдена
Среда
- Версия React Native: [/b]
Код: Выделить всё
0.77.0 - Версия Gradle: [/b] (URL распространения:
Код: Выделить всё
8.10Код: Выделить всё
https://services.gradle.org/distributions/gradle-8.10-all.zip1б / variant.outputs.each { output -> def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(com.android.build.OutputFile.ABI) if (abi != null) { output.versionCodeOverride = defaultConfig.versionCode * 1000 + versionCodes.get(abi) } } } } dependencies { implementation "com.facebook.react:react-android:0.77.0" if (hermesEnabled.toBoolean()) { implementation "com.facebook.react:hermes-android" } else { implementation jscFlavor } // other dependencies ... }Код: Выделить всё
android/build.gradleЧто я пробовалКод: Выделить всё
//ANDROID?BUILD.GRADLE // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { //* Upgraded targetSdkVersion and compileSdkVersion to android 14(level 34) ext { buildToolsVersion = "35.0.0" minSdkVersion = 24 compileSdkVersion = 35 targetSdkVersion = 35 ndkVersion = "28.2.13676358" kotlinVersion = "2.0.21" androidToolsVersion = "8.3.2" } repositories { google() mavenCentral() } dependencies { classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.21' classpath 'com.google.gms:google-services:4.4.2' classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2' classpath 'com.android.tools.build:gradle:8.5.2' } } // TEMP wiring – remove once the duplicate module is gone gradle.projectsEvaluated { def A = rootProject.findProject(':react-native-firebase_messaging') def B = rootProject.findProject(':@react-native-firebase_messaging') if (A && B) { [[A,B],[B,A]].each { pair -> def consumer = pair[0]; def producer = pair[1] // parse...LocalResources should wait for the other project's package...Resources consumer.tasks.matching { it.name ==~ /parse.*(Release|Debug).*LocalResources/ }.configureEach { dependsOn producer.tasks.matching { it.name ==~ /package.*Resources/ } } // merge/extractDeepLinks should wait for the other project's generate...ResValues consumer.tasks.matching { it.name ==~ /(merge|extractDeepLinks).*(Release|Debug)/ }.configureEach { dependsOn producer.tasks.matching { it.name ==~ /generate.*ResValues/ } } } } } // Fallback: ensure all Android subprojects have compileSdkVersion/ndkVersion if their // build.gradle doesn't set it explicitly (some third-party libs rely on the RN plugin). subprojects { subproject -> afterEvaluate { p -> if (p.hasProperty('android')) { try { p.android.compileSdkVersion = rootProject.ext.compileSdkVersion if (p.android.hasProperty('ndkVersion')) { p.android.ndkVersion = rootProject.ext.ndkVersion } } catch (Throwable ignored) { } } } }- Установить [/b] из-за сбоя сборки, вызванного
Код: Выделить всё
newArchEnabled=false[/b] внутриКод: Выделить всё
apply plugin: "com.facebook.react"[/b].Код: Выделить всё
@onfido/react-native-sdk/android/build.gradle - React Native обновлен до версии 0.77.0 и соответствующим образом выровнены библиотеки.
- Включено [/b] в
Код: Выделить всё
prefab true[/b].Код: Выделить всё
buildFeatures - Примененная упаковка. Варианты выбора и исключения.
- Проверенная нативная версия [/b] библиотеки, созданные для размера страницы 16 КБ.
Код: Выделить всё
.so - Проверенные версии Gradle и NDK.
- Разделение ABI включено с переопределением кода версии.
- Сборка проходит, но приложение вылетает при запуске с отсутствующим [/b].
Код: Выделить всё
libreact_featureflagsjni.so - Нативные библиотеки по-прежнему кажутся несовместимыми со страницами размером 16 КБ на Android 14 и более поздних версиях.
- Невозможно загрузить нативные библиотеки React Native, что приводит к сбою.
Подробнее здесь: https://stackoverflow.com/questions/797 ... on-startup - Установить