HostObject :: get中的异常:-React Native Build Android

HostObject :: get中的异常:-React Native Build Android,第1张

概述将我的React Native应用程序更新为React Native 0.59之后,尝试在调试模式下运行我的应用程序(react-native run-android)或生成软件包并将其安装到设备后,我开始遇到问题.以下是有关我的问题的信息:我的环境:React Native Environment Info: System: OS: macOS 10.

将我的React Native应用程序更新为React Native 0.59之后,尝试在调试模式下运行我的应用程序(react-native run-android)或生成软件包并将其安装到设备后,我开始遇到问题.

以下是有关我的问题的信息:

我的环境:

React Native Environment Info:System:  OS: macOS 10.14.3  cpu: (4) x64 Intel(R) Core(TM) i5-7360U cpu @ 2.30GHz  Memory: 479.23 MB / 8.00 GB  Shell: 3.2.57 - /bin/bashBinarIEs:  Node: 8.11.3 - /usr/local/bin/node  Yarn: 1.9.4 - /usr/local/bin/yarn  npm: 5.6.0 - /usr/local/bin/npm  Watchman: 4.9.0 - /usr/local/bin/watchmanSDKs:  iOS SDK:    Platforms: iOS 12.1,macOS 10.14,tvOS 12.1,watchOS 5.1  AndroID SDK:    API Levels: 26,27,28    Build Tools: 26.0.2,28.0.2,28.0.3IDEs:  Xcode: 10.1/10B61 - /usr/bin/xcodebuildnpmPackages:  react: 16.8.3 => 16.8.3   react-native: 0.59.1 => 0.59.1 npmGlobalPackages:  create-react-native-app: 1.0.0  react-native-cli: 2.0.1  react-native-git-upgrade: 0.2.7

React Native错误屏幕中的错误:

在我的BUGsnag上捕获的错误

Error · Module AppRegistry is not a registered callable module (calling runApplication)http://localhost:8081/index.delta?platform=androID&dev=true&Minify=false:3954:26invariant   http://localhost:8081/index.delta?platform=androID&dev=true&Minify=false:4674:18__callFunction  http://localhost:8081/index.delta?platform=androID&dev=true&Minify=false:4433:31    http://localhost:8081/index.delta?platform=androID&dev=true&Minify=false:4630:15__guard http://localhost:8081/index.delta?platform=androID&dev=true&Minify=false:4432:21callFunctionReturnFlushedQueue  [native code]callFunctionReturnFlushedQueue

我的build.gradle文件

buildscript {    ext {         buildToolsversion = "28.0.3"        minSdkVersion = 16        compileSdkVersion = 28        targetSdkVersion = 28        supportlibVersion = "28.0.0"    }    repositorIEs {        Google()        jcenter()        maven {            url 'https://maven.fabric.io/public'        }    }    dependencIEs {        classpath 'com.androID.tools.build:gradle:3.3.2'        classpath 'com.Google.gms:Google-services:4.2.0'        classpath 'com.Google.firebase:firebase-plugins:1.1.5'        classpath 'io.fabric.tools:gradle:1.26.0'    }}allprojects {    repositorIEs {        mavenLocal()        Google()        jcenter()        maven {            url "$rootDir/../node_modules/react-native/androID"        }    }}task wrapper(type: Wrapper) {    gradLeversion = '4.10.2'    distributionUrl = distributionUrl.replace("bin","all")}

我的app / build.gradle文件

apply plugin: "com.androID.application"apply plugin: "com.Google.firebase.firebase-perf"apply plugin: "io.fabric"import com.androID.build.Outputfileproject.ext.react = [    entryfile: "index.Js"]apply from: "../../node_modules/react-native/react.gradle"def enableSeparateBuildPercpuArchitecture = false/** * Run Proguard to shrink the Java bytecode in release builds. */def enableProguardInReleaseBuilds = falseandroID {    compileSdkVersion rootProject.ext.compileSdkVersion    defaultConfig {        applicationID "com.projectname"        minSdkVersion rootProject.ext.minSdkVersion        targetSdkVersion rootProject.ext.targetSdkVersion        versionCode 1        versionname "1.0"        ndk {            abiFilters "armeabi-v7a","x86"        }    }    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","x86_64"        }    }    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 ->            // 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,"arm64-v8a": 3,"x86_64": 4]            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            }        }    }}dependencIEs {    implementation project(':react-native-splash-screen')    implementation project(':@react-native-community_netinfo')    implementation project(':@react-native-community_async-storage')    implementation project(':react-native-linear-gradIEnt')    implementation project(':react-native-svg')    implementation project(':BUGsnag-react-native')    implementation 'com.androID.support:multIDex:1.0.3'    implementation project(':react-native-firebase')    implementation "com.Google.androID.gms:play-services-base:16.0.1"    implementation "com.Google.firebase:firebase-core:16.0.6"    implementation "com.Google.firebase:firebase-messaging:17.3.4"    implementation "com.Google.firebase:firebase-perf:16.2.3"    implementation('com.crashlytics.sdk.androID:crashlytics:2.9.5@aar') {        transitive = true    }    implementation project(':react-native-config')    implementation project(':react-native-device-info')    implementation project(':react-native-i18n')    implementation project(':react-native-vector-icons')    implementation project(':react-native-gesture-handler')    implementation filetree(dir: "libs",include: ["*.jar"])    implementation "com.androID.support:appcompat-v7:${rootProject.ext.supportlibVersion}"    implementation "com.facebook.react:react-native:+"  // From node_modules}// Run this once to be able to run the application with BUCK// puts all compile dependencIEs into folder libs for BUCK to usetask copyDownloadableDepsTolibs(type: copy) {    from configurations.compile    into 'libs'}apply plugin: 'com.Google.gms.Google-services'com.Google.gms.Googleservices.GoogleServicesPlugin.config.disabLeversionCheck = trueconfigurations.all {    resolutionStrategy.eachDependency { DependencyResolveDetails details ->        if (details.requested.group == 'com.Google.androID.gms'            && ( (details.requested.name == 'play-services-base') || (details.requested.name == 'play-services-maps') ) ) {            details.useVersion '16.0.1'        }    }}

在我的Metro-bundler加载100%后发生此错误(并且在Bundle Console屏幕上没有发生错误).

谢谢大家的帮助!

最佳答案该错误是因为您忘记在androID中安装某些模块,请检查MainApplication.java,检查是否导入了所有软件包,以及是否将其添加到ReactPackage列表中. 总结

以上是内存溢出为你收集整理的HostObject :: get中的异常:-React Native Build Android 全部内容,希望文章能够帮你解决HostObject :: get中的异常:-React Native Build Android 所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1145066.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存