【问题标题】:Cannot copy scripts from index.js to assets folder in react native无法将脚本从 index.js 复制到 react native 中的 assets 文件夹
【发布时间】:2018-07-20 06:26:02
【问题描述】:

每当我在 react native 中创建和运行示例应用程序时,我都会收到此错误“无法从资产 index.android.bundle 加载脚本”。所以我尝试了这个解决方案

1.mkdir assets 与 android/app/src/main

2.react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

3.react-native run-android

但收到此错误Plugin 0 specified in "E:\\SampleReact\\node_modules\\babel-preset-react-native\\index.js" provided an invalid property of "default" (While processing preset: "E:\\SampleReact\\node_modules\\babel-preset-react-native\\index.js")。在此之前,我收到错误无法在 react-native 中找到 Accessibility info,因此我将 RN 版本从 0.56 降级为 0.55.4。然后我尝试但收到上述错误。卡住了。请帮忙。问题是我刚刚安装了 Windows 10,所以我需要从一开始就安装所有依赖项(节点、android studio、react-native、java sdk 等)。所以请帮忙。

【问题讨论】:

    标签: javascript android reactjs react-native


    【解决方案1】:

    更改您的开发设置 ip,如果它的模拟器类似 (10.0.2.2:8081),如果设备 (yoursystemip:8081)。试试这个就行了

    【讨论】:

    • 感谢您的回复,我试过了,但还是一样。
    • 否则更改端口号,如果有防火墙,它可能不起作用
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-06-13
    • 2011-06-23
    • 1970-01-01
    • 2017-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多