RN隨記

環(huán)境

xcode 10.0
Android studio 3.4
"react": "16.8.6",
"react-native": "0.60.4",

step1 安裝yarn

npm install -g yarn react-native-cli

step2 創(chuàng)建項目

react-native init AwesomeProject
cd AwesomeProject
yarn install

step3 設置

設置版本號必須三位數

iOS:

 Bundle Identifier:xxxx.xxx.xxx
 version : 1.0.0
 pod install

Android:

 android->build.gradle dependencies{classpath("com.android.tools.build:gradle:3.3.1")}
 android->gradle->wrapper->properties distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
 android->app->build.gradle->defaultConfig versionName "1.0.0"

step4 運行

react-native run-ios
react-native run-android

iOS錯誤參考
** BUILD FAILED **


The following build commands failed:
    PhaseScriptExecution Run\ Script /development/misc/react/AwesomeProject/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Script-006B79A01A781F38006873D1.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.app
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
/development/misc/react/AwesomeProject/node_modules/promise/lib/done.js:10
      throw err;
      ^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

    at checkExecSyncError (child_process.js:470:13)
    at Object.execFileSync (child_process.js:490:13)
    at _runIOS (runIOS.js:91:34)
    at runIOS.js:24:5
    at tryCallTwo (/development/misc/react/AwesomeProject/node_modules/promise/lib/core.js:45:5)
    at doResolve (/development/misc/react/AwesomeProject/node_modules/promise/lib/core.js:200:13)
    at new Promise (/development/misc/react/AwesomeProject/node_modules/promise/lib/core.js:66:3)
    at Array.runIOS (runIOS.js:23:10)
    at Object.run (/development/misc/react/AwesomeProject/node_modules/react-native/local-cli/cli.js:86:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)

設置如下:參考

image.png

image.png

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子荣德,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,036評論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件披泪,死亡現場離奇詭異,居然都是意外死亡搬瑰,警方通過查閱死者的電腦和手機款票,發(fā)現死者居然都...
    沈念sama閱讀 93,046評論 3 395
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來泽论,“玉大人艾少,你說我怎么就攤上這事∫磴玻” “怎么了缚够?”我有些...
    開封第一講書人閱讀 164,411評論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長鹦赎。 經常有香客問我谍椅,道長,這世上最難降的妖魔是什么古话? 我笑而不...
    開封第一講書人閱讀 58,622評論 1 293
  • 正文 為了忘掉前任雏吭,我火速辦了婚禮,結果婚禮上陪踩,老公的妹妹穿的比我還像新娘杖们。我一直安慰自己,他們只是感情好肩狂,可當我...
    茶點故事閱讀 67,661評論 6 392
  • 文/花漫 我一把揭開白布摘完。 她就那樣靜靜地躺著,像睡著了一般傻谁。 火紅的嫁衣襯著肌膚如雪描焰。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,521評論 1 304
  • 那天,我揣著相機與錄音荆秦,去河邊找鬼。 笑死力图,一個胖子當著我的面吹牛步绸,可吹牛的內容都是我干的。 我是一名探鬼主播吃媒,決...
    沈念sama閱讀 40,288評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼瓤介,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了赘那?” 一聲冷哼從身側響起刑桑,我...
    開封第一講書人閱讀 39,200評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎募舟,沒想到半個月后祠斧,有當地人在樹林里發(fā)現了一具尸體,經...
    沈念sama閱讀 45,644評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡拱礁,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 37,837評論 3 336
  • 正文 我和宋清朗相戀三年琢锋,在試婚紗的時候發(fā)現自己被綠了。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片呢灶。...
    茶點故事閱讀 39,953評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡吴超,死狀恐怖,靈堂內的尸體忽然破棺而出鸯乃,到底是詐尸還是另有隱情鲸阻,我是刑警寧澤,帶...
    沈念sama閱讀 35,673評論 5 346
  • 正文 年R本政府宣布缨睡,位于F島的核電站鸟悴,受9級特大地震影響,放射性物質發(fā)生泄漏宏蛉。R本人自食惡果不足惜遣臼,卻給世界環(huán)境...
    茶點故事閱讀 41,281評論 3 329
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望拾并。 院中可真熱鬧揍堰,春花似錦、人聲如沸嗅义。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,889評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽之碗。三九已至蝙眶,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背幽纷。 一陣腳步聲響...
    開封第一講書人閱讀 33,011評論 1 269
  • 我被黑心中介騙來泰國打工式塌, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人友浸。 一個月前我還...
    沈念sama閱讀 48,119評論 3 370
  • 正文 我出身青樓峰尝,卻偏偏與公主長得像,于是被迫代替她去往敵國和親收恢。 傳聞我的和親對象是個殘疾皇子武学,可洞房花燭夜當晚...
    茶點故事閱讀 44,901評論 2 355