react-native 组建

重命名模块

重命名模块

使用的时候就可以使用@代替js文件夹了;

import Image from '@/common/components/CustomImage';




android添加native module需要在mainapplication getPackages添加



Q:couldn't find "libjpush218.so"

A:打包的时候并没有在libs中复制SO库到项目中。因此我们需要在build.gradle中告诉打包工具执行复制so库文件。

android {

...

sourceSets {

main {

jni.srcDirs = []

jniLibs.srcDirs = ['libs']

}

}

}

Q:调试打包的apk(install the signed apk onto your device)

A:$ react-native run-android --variant=releasewill



Q:/Users/zhangshuai/meteor/tagt/android/app/src/main/res/values/strings.xml:4: Error: "facebook_app_id" is not translated in "en" (English), "zh" (Chinese) [MissingTranslation]

A: 添加translatable属性name="facebook_app_id" translatable="false"


react重大事件:

React.createClassis now available as create-react-class,React.PropTypesas prop-types,React.DOMas react-dom-factories, react-addons-test-utils as react-dom/test-utils, and shallow renderer as react-test-renderer/shallow

更新慎重了,react在9.26之后彻底取缔React.createClass代替为create-react-class包


Q:com.android.dex.DexIndexOverflowException

A: 添加com.android.support:multidex 


Q:Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded

A:dexOptions {

javaMaxHeapSize "4g" //specify the heap size for the dex process

preDexLibraries false //delete the already predexed libraries

}


Q:Plugin with id 'com.github.dcendents.android-maven' not found.

A:buil.gradle中dependencies中添加

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'


Q:NDK is missing a "platforms" directory.

A试着更换android/build.gradle的版本


Q:Plugin with id 'com.jfrog.bintray' not found.

A:classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'


gradle android加载本地sdk配置

// 加载本地配置

Properties properties = new Properties()

properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {

user = properties.getProperty("bintray.user")

key = properties.getProperty("bintray.apikey")

configurations = ['archives']

pkg {

repo = "maven"  //发布到Bintray的哪个仓库里,就是在注册时新建仓库的名字

name = "ncalendar"  //在仓库中显示的项目名字

websiteUrl = siteUrl

vcsUrl = gitUrl

licenses = ["Apache-2.0"]

publish = true

}

}


Bridging-Header.h swift 与 object c混编

Xcode6之后不能自动引入的UIKit、Foundation的解决方法,以前可以不使用import就可以直接使用头文件中的内容



Q:升级0.49后以前0.45的pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

报错:The name of the given podspec `yoga` doesn't match the expected one `Yoga`

A:升级后模块名称Yoga变为小写的了yoga

yoga.podsec文件


xcode 屏蔽OS_ACTIVITY_MODE log OS_ACTIVITY_MODE = disable

XMLHttpRequest: status ==0,_response:

The resource could not be loaded because the App Transport Security policy requires the use of a sec


Installation Failed: Invalid Argument -iOS

cannot find module 'semver'

fbsdk模块 ios


你真的知道react-native版本是如何更新的吗?

react-native 与 react , expo版本对应关系


ref返回Null错误使用ref情况:


错误之处就在静态方法,defaultprops移到constructor解决



ios 支持 http

ios 设置多国语言版本

ios多国语言支持2


react-native canvas(webview) 卡屏严重(彻底放弃webview中使用)




react-native meteor 结合的教学老师

blink闪烁效果

输入框中文字实时变更

http 请求 json 或者 xml 或者 websocket

Unrecognized Font Family 'Material Icons'

ios真机调试

An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): Failed to install the requested application An application bundle was not found at the provided path. Provide a valid path to the desired application bundle. Print: Entry, ":CFBundleIdentifier", Does Not Exist

使用react-native-fetch-blob提示cannot read property 'DocumentDir‘ of

ios http TypeError: Network request failed

View.propTypes 在44后的正确使用方法 ViewPropTypes

加载本地图片时报Unexcepted character,关掉npm启动的命令行,重新运行,不要再模拟器中启动hot reload

react-native 国际化 i18n

react-native 包管理工具


Unrecognized font family 'FontAwesome' 解决方法:react-native link react-native-vector-icons

Cannot read property 'getPhotos' of undefined

React Native入坑之fetch() Network Request Failed

react-native 默认使用iphone 6 可以通过--simulator指定模拟器

ios创建HTTP请求报错

connect方法生成容器组件以后,需要让容器组件拿到state对象,才能生成 UI 组件的参数

Reducer 在异步操作结束后自动执行 . 中间件(middleware)

Store 收到 Action 以后,必须给出一个新的 State,这样 View 才会发生变化

redux 入门:store、reducer、action关联

redux api详解

React—组件生命周期详解

/react-native-navigation/ api详解

error: bundling: UnableToResolveError: Unable to resolve module react/lib/ReactComponentTreeHook(先install react在install react-native)

app调用微信等第三方平台,在info.plist文件中加LSApplicationQueriesSchemes,数组形式,把需要跳转的平台加上

xcode开发info.plist配置详解

AppDelegate.m配置详解

target -> build setting -> header search path 决定了后面在 appdelegate中导入内容的搜索路径

<react/reactemit.h> not found

ReactNative : ignoring return value of function declared with warn_unused_result attribute

__nw_connection_get_connected_socket_block_invoke Connection has no connected handler

错误: 找不到符号 return BuildConfig.DEBUG;

android --> build.gradle ependencies { provided 'com.facebook.react:react-native:0.+' }






需要配置xcode的react-native 模块

react-native-code-push

react-native-image-crop-picker

react-native-vector-icons

react-native-camera

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 199,902评论 5 468
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 84,037评论 2 377
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 146,978评论 0 332
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 53,867评论 1 272
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 62,763评论 5 360
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,104评论 1 277
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,565评论 3 390
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,236评论 0 254
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,379评论 1 294
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,313评论 2 317
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,363评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,034评论 3 315
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,637评论 3 303
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,719评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,952评论 1 255
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,371评论 2 346
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 41,948评论 2 341

推荐阅读更多精彩内容