НЕУСТРАНИМОЕ ИСКЛЮЧЕНИЕ: поток блокировки Firebase #0Android

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 НЕУСТРАНИМОЕ ИСКЛЮЧЕНИЕ: поток блокировки Firebase #0

Сообщение Anonymous »

Сегодня я столкнулся с проблемой, которая не позволяет мне запустить проект React Native на устройствах Android: он вылетает сразу после запуска. Вместо этого он нормально работает на устройствах iOS.
Это сложный проект, над которым работало так много людей, поэтому сложно отследить все разработки, произошедшие за эти годы.
Это журнал ошибки:

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

FATAL EXCEPTION: Firebase Blocking Thread #0
Process: com.app.MyApp, PID: 15882
java.lang.NoSuchMethodError: No static method checkNotGoogleApiHandlerThread()V in class Lcom/google/android/gms/common/internal/Preconditions; or its super classes (declaration of 'com.google.android.gms.common.internal.Preconditions' appears in /data/app/~~1MEi9R6kd8rP9d1okoXlBg==/com.app.MyApp-Zns5nVqwixkl4DB8j_rd5A==/base.apk)
at com.google.android.gms.tasks.Tasks.await(com.google.android.gms:play-services-tasks@@18.1.0:2)
at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.openHttpURLConnection(FirebaseInstallationServiceClient.java:487)
at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation(FirebaseInstallationServiceClient.java:163)
at com.google.firebase.installations.FirebaseInstallations.registerFidWithServer(FirebaseInstallations.java:533)
at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:387)
at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$3$FirebaseInstallations(FirebaseInstallations.java:372)
at com.google.firebase.installations.-$$Lambda$FirebaseInstallations$Kl2wdAe5utVajeTmV5LyfWUz3Bo.run(Unknown Source:4)
at com.google.firebase.concurrent.SequentialExecutor$1.run(SequentialExecutor.java:117)
at com.google.firebase.concurrent.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:229)
at com.google.firebase.concurrent.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:174)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0$CustomThreadFactory(CustomThreadFactory.java:47)
at com.google.firebase.concurrent.-$$Lambda$CustomThreadFactory$25wFMnJXuxCXflRCTG3ggSOiDOE.run(Unknown Source:4)
at java.lang.Thread.run(Thread.java:1012)
Проблема появилась с начала мая 2024 года, до сих пор никаких сбоев не выдавала.
Думаю, это связано с использованием push-уведомлений Firebase , возможно какие-то библиотеки уже несовместимы, но мне не удалось найти рабочую комбинацию.
Также прилагаю файлы build.gradle
android/build.gradle

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

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
ndkVersion = "21.4.7075529"

googlePlayServicesVersion = "17.0.0"
supportLibVersion   = "30.0.0"
//firebaseVersion = "17.3.4" // default: "+"
firebaseMessagingVersion = "+" // default: "+"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:4.2.2')
classpath('com.google.gms:google-services:4.3.3')
// NOTE: Do not place your application dependencies here;  they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}

google()
maven { url 'https://www.jitpack.io' }
}
}

android/app/build.gradle

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

apply plugin: "com.android.application"

import com.android.build.OutputFile

project.ext.react = [
enableHermes: false,  // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"

def enableSeparateBuildPerCPUArchitecture = false

/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false

/**
* The preferred build flavor of JavaScriptCore.
*
* 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:+'

def enableHermes = project.ext.react.get("enableHermes", false);

/**
* Architectures to build native code for in debug.
*/
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")

android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
applicationId "com.app.MyApp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1087
versionName "2.10"
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false  // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false  // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
if (nativeArchitectures) {
ndk {
abiFilters nativeArchitectures.split(',')
}
}
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.

//if release for play store
//signingConfig signingConfigs.release
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}

applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2,]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) {  // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}

packagingOptions {
exclude "META-INF/DEPENDENCIES"
}
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"   // From node_modules

implementation ("androidx.appcompat:appcompat:1.3.1") {
version {
strictly '1.3.1'
}
}

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}

debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}

compile (project(':react-native-push-notification')) { exclude group: 'com.facebook.react', module: 'react-native' }

compile project(':RNMail')

//implementation ('com.google.firebase:firebase-analytics:17.3.0') { exclude group: 'com.google.firebase', module: 'firebase-iid' }
}

apply plugin: 'com.google.gms.google-services'

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.implementation
into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

configurations.all {
resolutionStrategy.force "com.google.android.gms:play-services-gcm:${rootProject.googlePlayServicesVersion}", "com.google.android.gms:play-services-basement:15.0.1"
}
Я пытался использовать и синхронизировать разные версии «googlePlayServicesVersion» («11.8.0», «17.0.2», «18.1.0», ...) в android/build .gradle, используйте разные версии "buildToolsVersion" в android/build.gradle, используйте разные версии "firebaseMessagingVersion" в android/build.gradle, используйте разные JDK, обновите Android Studio "2023.3.1",...
Ожидание:
запустите проект на устройствах Android.
Пожалуйста, помогите :(

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

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

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

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

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

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

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