【问题标题】:How to turn on Development bundling in react native for android?如何在 react native for android 中打开开发捆绑?
【发布时间】:2019-11-07 11:09:35
【问题描述】:

我开发了一个应用程序,然后通过手动创建捆绑包创建了调试版本,该版本将在没有服务器的情况下为该应用程序运行。

我怎样才能回到开发模式,在那里我可以看到实时重新加载选项?

当我运行 react-native run-android 时,它会启动 Metro bundler,但不会捆绑所做的更改。

而且,开发设置不会通过摇晃进入手机。

尝试了其他 SO 线程的建议更改,但没有成功。

project.ext.react = [
entryFile: "index.js",
enableHermes: false,  // clean and rebuild if changing
bundleInDebug: true,
devDisabledInDebug: false,
bundleInRelease: false

]

请帮忙。

【问题讨论】:

    标签: react-native react-native-android


    【解决方案1】:

    在 Application 类中,我更改了以下代码。这解决了我的问题。

     public boolean getUseDeveloperSupport() {
          return true; // earlier it was BuildConfig.DEBUG
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-04
      • 2018-05-02
      • 2016-10-16
      • 1970-01-01
      • 2017-05-21
      相关资源
      最近更新 更多