React Native – как исправить Java.lang Double не может быть преобразован в java.lang.BooleanAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 React Native – как исправить Java.lang Double не может быть преобразован в java.lang.Boolean

Сообщение Anonymous »

Уже пару дней я сталкиваюсь с неприятной проблемой (только для Android).
Изображение

Казалось, это произошло внезапно. И я не могу обойти эту проблему. Пожалуйста, смотрите ниже мой проект Gradle:

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

buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

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

wrapper {
gradleVersion = '4.7'
distributionUrl = distributionUrl.replace("bin", "all")
}
а теперь мое приложение Gradle:

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

apply plugin: "com.android.application"

import com.android.build.OutputFile

project.ext.react = [
entryFile: "index.js"
]

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

def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false

android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
applicationId "com.my app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 110000
versionName "1.1.0"
}
signingConfigs {
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
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false  // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// applicationVariants are e.g.  debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3]
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
}
}
}
buildToolsVersion '28.0.3'
}

dependencies {
implementation project(':react-native-firebase')
implementation project(':react-native-device-info')
implementation project(':react-native-gesture-handler')
implementation project(':rn-splash-screen')
implementation project(':react-native-vector-icons')
implementation project(':react-native-picker')
implementation project(':react-native-image-picker')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation "com.google.android.gms:play-services-base:17.0.0"
implementation "com.google.firebase:firebase-messaging:19.0.1"
implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
implementation "com.facebook.react:react-native:+"  // From node_modules

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}

// 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.compile
into 'libs'
}

apply plugin: 'com.google.gms.google-services'
Я безуспешно пытался проследить трассировку стека, показанную выше. Также я попытался удалить все getBoolean (в качестве теста), где они видны в ReadableNativeArray.java, но безуспешно. Я удалил node_modules, переустановил, ничего нет. Еще одна деталь: эта ошибка появляется ПЕРЕД проверкой работы npm.
К вашему сведению, на iOS все идет хорошо, поэтому я не думаю, что проблема связана с каким-либо установленным пакетом.

Подробнее здесь: https://stackoverflow.com/questions/579 ... ng-boolean
Ответить

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

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

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

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

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