react-native 組建

重命名模塊

重命名模塊

使用的時候就可以使用@代替js文件夾了;

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




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



Q:couldn't find "libjpush218.so"

A:打包的時候并沒有在libs中復(fù)制SO庫到項目中。因此我們需要在build.gradle中告訴打包工具執(zhí)行復(fù)制so庫文件。

android {

...

sourceSets {

main {

jni.srcDirs = []

jniLibs.srcDirs = ['libs']

}

}

}

Q:調(diào)試打包的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"? //發(fā)布到Bintray的哪個倉庫里,就是在注冊時新建倉庫的名字

name = "ncalendar"? //在倉庫中顯示的項目名字

websiteUrl = siteUrl

vcsUrl = gitUrl

licenses = ["Apache-2.0"]

publish = true

}

}


Bridging-Header.h swift 與 object c混編

Xcode6之后不能自動引入的UIKit、Foundation的解決方法,以前可以不使用import就可以直接使用頭文件中的內(nèi)容



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變?yōu)樾懙牧藋oga

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版本對應(yīng)關(guān)系


ref返回Null錯誤使用ref情況:


錯誤之處就在靜態(tài)方法,defaultprops移到constructor解決



ios 支持 http

ios 設(shè)置多國語言版本

ios多國語言支持2


react-native canvas(webview) 卡屏嚴重(徹底放棄webview中使用)




react-native meteor 結(jié)合的教學(xué)老師

blink閃爍效果

輸入框中文字實時變更

http 請求 json 或者 xml 或者 websocket

Unrecognized Font Family 'Material Icons'

ios真機調(diào)試

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,關(guān)掉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創(chuàng)建HTTP請求報錯

connect方法生成容器組件以后,需要讓容器組件拿到state對象,才能生成 UI 組件的參數(shù)

Reducer 在異步操作結(jié)束后自動執(zhí)行 . 中間件(middleware)

Store 收到 Action 以后,必須給出一個新的 State,這樣 View 才會發(fā)生變化

redux 入門:store、reducer、action關(guān)聯(lián)

redux api詳解

React—組件生命周期詳解

/react-native-navigation/ api詳解

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

app調(diào)用微信等第三方平臺,在info.plist文件中加LSApplicationQueriesSchemes,數(shù)組形式,把需要跳轉(zhuǎn)的平臺加上

xcode開發(fā)info.plist配置詳解

AppDelegate.m配置詳解

target -> build setting -> header search path 決定了后面在 appdelegate中導(dǎo)入內(nèi)容的搜索路徑

<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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容