如何在React Native for Android Apps中设置canOverrideExistingModule = true? [英] How to set canOverrideExistingModule=true in React Native for Android Apps?

查看:961
本文介绍了如何在React Native for Android Apps中设置canOverrideExistingModule = true?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用React Native构建了一个Android应用程序,它已经成功构建但是当我在我的Android虚拟设备中运行应用程序时,它会显示一个完整的红色屏幕,并显示以下错误:

I built an android app using React Native, it got built successfully but when I run the app in my Android Virtual Device it shows up a full red screen with the following error:

我之前没有完成本机应用程序开发,也没有任何Java知识所以我不知道这个错误是什么意思以及如何解决这个问题。

推荐答案

相关包的名称此错误不是 AirMapModule ,而是来自 com.airbnb.android.react.maps的 MapsPackage

The name of the package associated to this error is not AirMapModule but MapsPackage from com.airbnb.android.react.maps.

在目录中的 MainApplication.java 中: android / app / src / main / java /../../删除任何重复的条目:

In your MainApplication.java in directory : android/app/src/main/java/../../ remove any duplicate entry of :


  • 导入包: import com.airbnb.android.react.maps.MapsPackage

  • 对模块构造函数的调用: new MapsPackage () in function getPackages

  • the import package : import com.airbnb.android.react.maps.MapsPackage
  • the call to the constructor of the module : new MapsPackage() in function getPackages

这篇关于如何在React Native for Android Apps中设置canOverrideExistingModule = true?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆