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
======================
RN与android原生开发混合后的环境报错问题的更多相关文章
- Android项目开发填坑记-9patchPng报错
如果阅读体验不佳,请使用–> Github版 背景 之前写了一篇文章Android必知必会–NinePatch图片制作详细介绍了Android 9Patch图片的制作和一些Demo展示,这次说明 ...
- [RN] windows7 安装 Realm Studio 后,打开报错 A JavaScript error occurred in the main process
windows7 安装 Realm Studio 后,打开报错 报错如下: A JavaScript error occurred in the main process Uncaught Exce ...
- 关于在biweb 中安装完成后 首页上方报错问题的解决
在利用biweb进行网站开发的时候 首先得安装biweb 安装就是下一步,,,下一步....下一步 最后就成功了 .但是有种情况我总是竟让遇到,而已有的人安装会遇到 有的人安装就不会遇到,后 ...
- 解决Ubuntu(Linux)平台下Sublime Text 3 安装中文输入支持库后 开启gnome-terminal报错的问题
在Ubuntu下安装Sublim Text3后发现无法输入中文,按照此链接的方法解决后.然后用下列代码配置C++的编译系统: { "cmd":["g++",&q ...
- 安装VS 2015完成后,VS2012 打开报错
安装VS 2015完成后,VS2012 打开报错 打开VS2012Web项目,弹出错误提示: asp.net 4.0 has not been registered on the web server ...
- 在Linux上配置xampp后远程访问域名报错
在Linux上配置xampp后远程访问域名报错: New XAMPP security concept: Access to the requested object is only availabl ...
- 在把webpack作为本地开发依赖安装的时候报错
在把webpack作为本地开发依赖安装的时候报错 Refusing to install webpack as a dependency of itself 原因是package.json里的name ...
- 运行编译后的程序报错 error while loading shared libraries: lib*.so: cannot open shared object file: No such file or directory
运行编译后的程序报错 error while loading shared libraries: lib*.so: cannot open shared object file: No such f ...
- 修改了系统自带头文件后,Xcode会报错
1.Xcode自带头文件的路径 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Develo ...
随机推荐
- (1.10)SQL优化——mysql 常见SQL优化
(1.10)常用SQL优化 insert优化.order by 优化 1.insert 优化 2.order by 优化 [2.1]mysql排序方式: (1)索引扫描排序:通过有序索引扫描直接返回有 ...
- 前端 HTML 常用标签 head标签相关内容 style标签 定义内部样式表
styple标签 <!-- 定义内部样式表 --> <style type="text/css"></style>
- 发现Boost官方文档的一处错误(numpy的ndarray)
文档位置:https://www.boost.org/doc/libs/1_65_1/libs/python/doc/html/numpy/tutorial/ndarray.html shape在这里 ...
- finally最常用的情况
通常用于关闭(释放)资源例如:数据库连接 执行查询时查到需要的需要后 需要关闭连接, 此处连接就需要在获取到结果后 就断开连接 不然访问人数过多,数据库有最大连接数,超过了就只能等待前 ...
- POJ1611:The Suspects(模板题)
http://poj.org/problem?id=1611 Description Severe acute respiratory syndrome (SARS), an atypical pne ...
- 2019.03.23 Cookie
Cookie 曲奇饼干 哈哈哈.通俗的将,应该是发票. 因为http是无状态操作 当你访问服务器之后,应该会给你响应发票Cookie记录你访问了什么东西 便于下次再来查找吧,Cookie有时间的限 ...
- python one
哈哈,今天把它搞了 谁? Python啊! ..... *************************************** python:解释性语言,功能很强大,现在很有市场! & ...
- iOS 添加启动图片
之前添加启动图片,一直都是通过添加LaunchImage来实现,见链接 http://www.cnblogs.com/jys509/p/4856068.html 这种方法,就需要给每个尺寸添加图片. ...
- 读书笔记_Effective_C++_条款三:尽可能使用const
const是常量的意思,它可以定义一个不可改变的量,主要用于以下几个地方: 1. 修饰变量,使之不可改变 举个例子: const int var = 3; 此时var的值就不能改变了.也正是因为con ...
- Linux常用网络工具:Http压力测试之ab
ab的全称是Apache Bench,是Apache自带的网络压力测试工具,相比于LR.JMeter,是我所知道的 Http 压力测试工具中最简单.最通用的. ab命令对发出负载的计算机要求很低,不会 ...