【问题标题】:React Native configuration for existing Android project现有 Android 项目的 React Native 配置
【发布时间】:2017-06-21 21:45:41
【问题描述】:

我正在尝试使用最新的 React Native 版本 0.45.1 将 React Native 集成到我现有的 Android 应用程序中。

项目设置是由init 命令创建的标准设置。在 android 子文件夹中,我检查了我现有的 Android 应用程序并按照Integration With Existing Apps 中的步骤进行操作

当运行react-native run-android 时,它让我着迷:

ENOENT: no such file or directory, open 'app/src/main/AndroidManifest.xml'

这显然是由于我的非标准 Android 项目结构,因为我有几个模块,而我的主模块没有命名为 app

现在真正的问题是:有没有办法配置 React Native 层并告诉它我的 Manifest 和其他可能需要的文件驻留在哪里?

【问题讨论】:

    标签: android react-native react-native-android


    【解决方案1】:

    Got 其实很简单。 --help 是你的朋友。

    --appFolder [string]      Specify a different application folder name for the android source.
    

    正是我想要的。对于有类似问题的任何人,还有一些其他有趣的选择。

    【讨论】:

    • 您能否更好地解释一下您为解决此问题所做的工作。
    • react-native run-android --appFolder 。我将项目名称从 app 更改为 myapp,因此我运行了“react-native run-android --appFolder myapp”,它成功了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-14
    • 2020-05-14
    • 2019-09-02
    • 2022-01-14
    • 1970-01-01
    • 2022-08-10
    • 2023-02-06
    相关资源
    最近更新 更多