RN与android原生开发混合后的环境报错问题
RN与android原生开发混合后的环境报错问题
需要先安装nodejs
$ yarn --version
1.12.1
更新当前版本
yarn upgrade --latest
安装 | Yarn
https://yarnpkg.com/lang/zh-hans/docs/install/#windows-stable
================
到对应目录下用git bash here执行:
yarn
================
yarn start
npm install
================
rn混合后编译卡的问题,到D:\exchangespace目录下,cmd执行下面命令打包到D:\exchangespace\android\app\src\main\assets里面直接使用,只有rn的代码更新了才需要重新打包
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\
=================
有时候构建Android studio项目,会莫名出现
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
Error:resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found的问题,并且还会引起一系列其他的问题。
修改方法:
将compileSdkVersion修改成25,并将对应的buildToolsVersion修改成25.0.2
=================
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation' and 'testApi'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.facebook.react:react-native:+'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.facebook.react:react-native:+'
}
------------
compile --> implementation
testCompile --> testImplementation
testApi --> testImplementation
provided --> compileOnly
======================
不同严重程度可以按以下三种处理:
1.切换到project视图,删除.grade .idea 文件夹,clean project,
2.关闭android,重新打开编译
3.彻底清除缓存 File -> Invalidate Caches / Restart... (会清理掉本地修改的Gradle配置)
======================
Quit emulator
Quit Android Studio
Reopen Android Studio
Build > Clean Project
Run/debug your app onto your device/emulator again
======================
golang技术交流群:316397059,vuejs技术交流群:458915921 囤币一族:621258209,有兴趣的可以加入
微信公众号: 心禅道(xinchandao)投资论道
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?