react-native 组建

重命名模块

react-native 组建_第1张图片
重命名模块

使用的时候就可以使用@代替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情况:


react-native 组建_第2张图片
react-native 组建_第3张图片
错误之处就在静态方法,defaultprops移到constructor解决



ios 支持 http

ios 设置多国语言版本

ios多国语言支持2


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


react-native 组建_第4张图片



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中导入内容的搜索路径

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

你可能感兴趣的:(react-native 组建)