「原生 + RN 混合工程」一条命令启动全攻略:解密 react-native.config.js

react-native-config:给您的移动应用带来12点爱! React Native应用程序的配置变量 在React Native中将配置变量公开给您的javascript代码的模块,支持iOS,Android和Windows。 为您的移动应用带来约爱! 基本用法 在您的React Native应用程序的根目录中创建一个新文件.env : API_URL=https://myapi.com GOOGLE_MAPS_API_KEY=abcdefgh 然后从您的应用程序访问在那里定义的变量: import Config from "react-native-config" ; Config . API_URL ; // 'https://myapi.com' Config . GOOGLE_MAPS_API_KEY ; // 'abcdefgh' 请记住,此模块不会混淆或加密用于打包的秘密,因此请勿将敏感密钥存储在.env 。 ,,因此请牢记这 立即下载

Hybrid 开发模式越来越常见:原生 Android / iOS + React Native 模块混合开发。

但是,很多人遇到一个小坑:

我想直接在 Hybrid 工程里执行 yarn android,像纯 RN 工程一样一键跑起来,结果报错!

为什么会这样?React Native CLI 默认只认 ./android、./ios,根本不知道你的原生主工程在哪。

今天,我们就来揭秘 react-native.config.js,教你轻松解决这个问题,让 Hybrid 工程也能一条命令启动。


一、Hybrid 工程典型结构

先来看一个常见目录:

/HybridApp
   ├── /appA                # 原生 Android 工程(主工程)
   │     └── build.gradle
   │
   ├── /rnmodule            # React Native 模块
   │     ├── android/       # RN 的 Android library
   │     └── index.js
   │
   ├── package.json
   └── react-native.config.js

如果直接 yarn android,CLI 会去找 ./android,
但我们的 真正入口在 appA —— 所以它当然会失败。


二、解决方案:配置 react-native.config.js

在根目录加一个配置文件:

// react-native.config.js
module.exports = {
  project: {
    android: {
      sourceDir: './appA',   // 指定原生主工程路径
    },
  },
  assets: [
    // 如果有字体、图片需要自动拷贝,可以在这里配置
    // 'rnmodule/assets/fonts',
  ],
};

这样,执行 yarn android 时,CLI 会自动进入 ./appA,执行:

cd appA && ./gradlew installDebug

APK 就能顺利安装并启动了 🚀

同时,Debug 模式下 JSBundle 会走 Metro,方便热更新调试。


三、react-native.config.js 的历史演进

  • RN 0.59 及以前
    没有 react-native.config.js,CLI 默认死板地只认 ./android、./ios。
    要改路径只能硬改 CLI 源码。

  • RN 0.60 引入
    react-native.config.js 正式登场,替代早期的 rnpm。
    支持配置:dependencies、assets、project.android.sourceDir、project.ios.sourceDir。

  • RN 0.62+
    react-native link、run-android、run-ios 全部基于这个配置。

  • RN 0.70+
    CLI 拆分成 @react-native/cli,但 react-native.config.js 依然是推荐方式。

👉 也就是说,从 RN 0.60 起就能用了,一直到今天都稳定可用。


四、CLI 内部调用链

那 CLI 到底是怎么用这个配置的呢?
以 yarn android 为例,调用链大致是这样:

yarn android
   ↓
react-native/cli.js
   ↓
@react-native/cli (或 @react-native-community/cli)
   ↓
loadConfig(projectRoot)
   └── 读取 react-native.config.js
   ↓
run-android/index.js
   └── const sourceDir = config.project.android.sourceDir || 'android'
   ↓
cd ${sourceDir} && ./gradlew installDebug

一句话总结:

👉 CLI 每次执行命令时,都会去读取 react-native.config.js,
然后用里面的 sourceDir 来决定去哪执行 gradlew。


五、最终效果

配置好后,Hybrid 工程就能像纯 RN 工程一样用了:

yarn start    # 启动 Metro
yarn android  # 编译 appA 原生工程并安装到手机

再也不用手动 cd appA && ./gradlew installDebug 了,舒服~


🎯 总结

  • Hybrid 工程默认 yarn android 会失败,因为 CLI 不知道主工程在哪。
  • 在 react-native.config.js 里配置 project.android.sourceDir,就能解决。
  • 这个机制从 RN 0.60 起支持,到现在依然是官方推荐做法。
  • CLI 调用链:命令行 → 读取配置 → 确定工程目录 → 调用 gradlew。

小结一句话:配置 react-native.config.js,让 Hybrid 工程也能“一条命令启动”,从此告别手动切换目录和命令的烦恼。

react-native-config-node:用于Node.js环境中react-native-config的模拟,用于测试 react-native-config-node 适用于react-native-config的Node.js模拟 用于模拟程序,该模块提供了一种将环境特定的变量注入的优雅方法。 由于react-native-config包含本机代码,因此无法在Node.js环境中运行。 我们提供了一种模拟模块的方法。 安装 通过NPM: npm install --save-dev react-native-config-node 通过纱线: yarn add -D react-native-config-node 用法 摩卡咖啡 使用babel-register创建一个编译器文件。 test/lib/babel-register.js module . exports = require ( 'babel-register' ) ( { plugins : [ 'react-na 立即下载

相关推荐

联想Y9000P安装Ubuntu20.04记录

联想Y9000P 2022安装Ubuntu20.04问题记录

Legendyyy的博客 7131

react-native-config 使用

【代码】react-native-config 使用。

peade的博客 1935

25年PINN创新点大盘点!

在科研论文的激烈角逐中,想轻松产出高含金量成果?物理信息神经网络(PINN)堪称“宝藏研究方向”,是冲击高分区论文的绝佳赛道!对于渴望发表优质论文的科研伙伴,这三大研究路径值得重点关注。首先是自适应PINN,在PINN训练过程中,物理方程与实测数据间的矛盾常常导致权重调节困难,而恰好直击这一痛点,是极具价值的研究方向。其次,同样前景广阔,传统多物理场同时训练效果欠佳,如今分阶段训练方法脱颖而出,成效显著且竞争较小。最后,探索及多任务学习等技术的融合,能实现优势叠加,碰撞出创新火花。

Malaai的博客 1980

react native 多平台配置,使用react-native-web运行在web端(自定义webpack.config.js配置篇)

官方脚手架有一个App.tsx文件在根目录,而react-native-web官方提供的 webpack 配置并没有配置解析这个文件,需要添加到include。当然,如果你觉得文章有什么让你觉得不合理、或者有更简单的实现方法又或者有理解不来的地方,希望你在看到之后能够在评论里指出来,我会在看到之后尽快的回复你。本篇文章使用的自定义 webpack 配置的方式,配置起来相对麻烦一点。配置 html-webpack-plugin 插件。这个插件是官网没有提到的,算是一个坑。webpack配置在官网 -

好巧的博客 5605

基于PlatformIO与CMSIS的STM32库函数开发实战:从环境搭建到外设驱动

本文详细介绍了基于PlatformIO与CMSIS的STM32库函数开发实战,从环境搭建到外设驱动实现。通过对比传统IDE,PlatformIO结合CMSIS框架在跨平台开发、代码可移植性和调试体验上更具优势。文章包含PlatformIO.ini配置详解、GPIO/USART驱动开发实例及常见问题解决方案,帮助开发者高效完成STM32项目开发。

weixin_29190169的博客 429

数字IC设计避坑指南:为什么477条net的DRV问题无法修复?解析don‘t touch hierarchy的影响

本文深入解析了数字IC后端实现中,因“don't touch hierarchy”约束导致大量DRV违规(如477条net)无法自动修复的根本原因。文章以Cadence Innovus工具为例,详细阐述了DRV修复机制与设计保护约束的冲突原理,并提供了从日志定位、风险评估到分级解除约束的完整实战策略,帮助工程师有效解决此类设计收敛难题。

hope8的博客 293

如何快速配置React Native环境变量:React Native Config完整教程

React Native Config是一个功能强大的开源库,专为React Native应用设计,帮助开发者轻松管理不同环境的配置变量。无论是开发、测试还是生产环境,它都能让环境变量的配置变得简单高效,是React Native项目中不可或缺的工具。 ## 📚 什么是React Native Config? React Native Config是一个轻量级的库,允许你在React Nat

gitblog_00738的博客 500

IROS 2025机器人技术解析:从诡异设计到硬核应用

机器人技术正从传统的结构化环境应用,迈向复杂非结构化场景的深度交互。其核心原理在于通过仿生设计、多模态感知与智能控制算法,赋予机器人类似生物的适应性与交互能力。这一技术演进的价值在于突破传统机器人在极端环境、精密操作和自然交互中的瓶颈。例如,结合深度强化学习的全身动力学控制,使机器人能在废墟、管道等复杂地形中自主导航;而软体机器人技术则通过材料变形实现安全、柔顺的抓取操作。这些技术最终服务于极端环境巡检、精密装配和高端陪护等刚性应用场景,推动机器人从功能实现迈向与环境、人进行深度、智能交互的新阶段。

weixin_34006468的博客 457

react-native配置多环境步骤

本文介绍了在Windows系统下为React Native项目配置多环境的方法

qq_36821274的博客 516

别再只会用QTcpSocket了!手把手教你用QSslSocket为你的Qt网络应用加上SSL/TLS加密(附完整代码示例)

本文详细介绍了如何将Qt网络应用从QTcpSocket迁移到QSslSocket,实现SSL/TLS加密传输。通过对比API差异、解析核心机制和提供完整代码示例,帮助开发者快速掌握安全网络编程技巧,有效防范数据窃听和中间人攻击等安全风险。

weixin_30654583的博客 404

基于非接触式微波雷达设计的跌倒检测预警系统【短信报警】

本项目选择基于非接触式微波雷达的跌倒检测预警装置作为技术核心,采用云帆瑞达的R60AFD1跌倒检测模组。这一模组能够根据人体的运动变化,如速度、距离和姿态等特征,判断是否发生跌倒,并可以持续监控老年人是否处于危险状态。此外,本项目还结合4G通信技术,通过Air724UG模块实现短信报警功能,一旦检测到跌倒事故,系统将自动通过4G网络向紧急联系人发送短信报警,及时通知亲属或医护人员进行救援。

1762

【亲测免费】 让React Native应用配置更简单:react-native-config

在开发React Native应用时,配置管理是一个不可忽视的环节。`react-native-config` 模块正是为此而生,它允许你在React Native应用中轻松管理配置变量,支持iOS、Android和Windows平台。通过简单的配置,你可以在应用中访问这些变量,实现配置与代码的分离,让你的应用更具灵活性和可维护性。 ## 项目技术分析 `react-native-config...

gitblog_00095的博客 433

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

ReactNative项目构建分析与思考之 cli-config

前言 在上一篇 native_modules.gradle分析 文章中,我们对三方库是如何依赖到Android项目有了一个大致的了解。 在 native_modules.gradle 的 getReactNativeConfig 方法中,执行了一个node命令,然后得到了非常关键的 reactNativeConfigOutput后续的流程才能正常走下去。 String[] reactNativeConfigCommand = ["node", cliPath, "config"] def reactNa

喻志强的博客 1841

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

终极免费在线图表编辑器:Mermaid Live Editor 5分钟从零到精通指南

还在为技术文档中的图表绘制而烦恼吗?是否厌倦了拖拽式工具的繁琐操作?Mermaid Live Editor 作为一款革命性的开源在线图表编辑器,通过创新的文本驱动方式,让开发者用代码思维轻松创建专业图表。这款免费实时图表创作工具不仅提升了个人效率,更通过标准化的图表语法推动了团队协作模式的革新。 ## 痛点分析:传统图表工具的三大困境 ### 🚫 拖拽式工具的繁琐操作 传统图表工具如Visi

gitblog_00350的博客 561

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

强力推荐:React Native应用的环境配置利器 - React-Native-Config

强力推荐:React Native应用的环境配置利器 - React-Native-Config 在移动开发领域,尤其是在React Native的生态系统中,管理不同环境下的配置变量始终是一个挑战。但今天,我们要向大家隆重介绍一个便捷、高效的解决方案——React-Native-Config,这是一款专为React Native设计的环境配置模块,兼容iOS、Android乃至Windows平台...

gitblog_00027的博客 872

React Native Config完整教程:从基础设置到高级用法详解

React Native Config是移动应用开发的终极环境变量管理解决方案,为React Native项目带来12因素应用(12-factor app)的配置管理理念。本教程将带你从基础安装到高级多环境配置,全面掌握这个强大的工具。 ## 🚀 为什么需要React Native Config? 在移动应用开发中,不同环境(开发、测试、生产)需要不同的配置参数,如API地址、第三方服务密钥

gitblog_00263的博客 490

React-Native项目 — 自定义字体的使用

在实际的移动端项目开发中,原生安卓和Ios自带的字体,虽然足够工整、耐看、适配大多数的场景。但是在一些特殊场合下,那些规范的字体,可能不太适合我们的app设计,而且,通常情况下,设计师的设计元素里面,本身也包含了一些第三方的特殊字体的使用,这就使得我们的项目中,有足够的能力,支持第三方的字体使用。计算机中,针对全世界的语言符号,进行了一次标准的排序,每一个专门的文字符号,都有对应的一个字符编码,我们汉语也是一样,每一个单独的汉字,都有其特定的编码。

程序员老李|前阿里技术专家,10 年前端。 做免费办公工具:图片压缩、PDF、Markdown、在线简历,全在浏览器本地处理。 文件不上传,不用注册。技术栈 Canvas、WebAssembly、Web Worker。 2571

Vue Native终极环境变量管理指南:轻松集成react-native-config

在移动应用开发中,环境变量管理是确保应用在不同环境下正确运行的关键。Vue Native作为构建跨平台原生移动应用的框架,结合react-native-config可以完美解决环境配置问题。本文将详细介绍如何在Vue Native项目中高效管理环境变量,让您的开发工作更加顺畅。✨ ## 🤔 为什么需要环境变量管理? 在移动应用开发过程中,我们经常需要处理不同环境的配置: - **开发环境*

gitblog_00477的博客 785

React Native CLI 项目配置详解:react-native-community/cli 核心功能解析

React Native CLI 项目配置详解:react-native-community/cli 核心功能解析 什么是 React Native 项目? 在 React Native 生态中,项目(Project)是指包含 React 代码并依赖 react-native 的应用程序。React Native CLI 作为官方命令行工具,提供了强大的项目配置能力,让开发者能够根据项目需求自定义...

gitblog_00998的博客 761

React Native环境配置完整版(超详细)

为方便不同项目所需Node.js版本不同,降低后续项目要给Node.js降级的麻烦,先安装NVM管理Node.js,NVM可以很方便的切换版本。在进行环境配置之前,设置文件权限,避免之后报错。右键D盘Program Files文件下的nodejs文件,属性-安全-编辑-允许-应用-确定。至此,NVM和Node.js配置完成。然后直接点击install即可。找到V1.1.11版本。

m0_75050943的博客 7514

npx react-native run-android报error Android project not found

在搭建react-native开发环境的环境的时候,到了npx react-native run-android最后一步的时候,竟然出现以下错误: error Android project not found. Are you sure this is a React Native project? If your Android files are located in a non-standard location (e.g. not inside 'android' folder), consid

weixin_42404361的博客 2045

现有Android项目 集成 React Native (一)

(测试 是否可以启动服务 暂时不要run android 因为 app还没配置依赖)生成 node_modules 文件和package-lock.json 文件。(为了解决 此文件 丢失导致 error no Metro found。(解决项目启动 找不到默认 android路径 现有项目集成路径变了)生成 package.json 文件。

huoruohe的博客 992

【React Native原生项目不能运行npx react-native run-android项目】

运行命令报错,帮我修复X:\jetbrains-workspace\theme-wallpaper>npx react-native run-android。

努力学习 624

关于React Native版本≥0.60使用 react-native link无效的解决方案(react-native link @ant-design/icons-react-native)

1. 在ReactNative项目根目录创建react-native.config.js文件 2.添加以下代码 module.exports = { project: { ios: {}, android: {} }, assets: ["./assets/fonts/"] }; 3.将需要的字体文件复制到项目目录src/assets/fonts/ 下面 4.在项目根目录运行react-native link或npx react-native l...

眼泪成诗的专栏 4362
上一篇: Kotlin 空安全完整指南:彻底告别NullPointerException
下一篇: 跨平台开发框架全景分析:Flutter、RN、KMM 与腾讯 Kuikly 谁更值得选择?
wayne214
博客等级 码龄11年 312粉丝 232原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值