公司打算作App,但其實咱們前端組都沒有相關App經驗,只能摸着石頭過河了,跌跌撞撞到如今,總算是ios提交審覈了,由於ios審覈目前已被拒兩次,目前還在審覈中,想把整個過程整理出來,記錄遇到的問題和解決辦法html
下載時按照文檔中的國內下載連接指示一步步操做,在init項目的時候出現問題react
找了相關文檔說是這個原本就是慢,雖然是卡着不動,但須要耐心等待,等了一兩個小時(也有等半小時就有結果的,也有一個小時的,我一開始等了一下子沒反應就直接停掉,從新下,後來看到他們說就是慢,要耐心等待,才又等了兩三個小時)才顯示下載失敗,失敗後按照提示打開對應目錄並用pod install 繼續去下載cocoapods,再次嘗試了好幾回,最終在夜深人靜沒人搶網的狀況下下載成功了(下載成功的那次歷時三四個小時)$ pod repo remove master
$ pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
$ pod repo update
$ cd ~/.cocoapods/repos
$ pod repo remove master
$ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
複製代碼
cd AwesomeProject
react-native run-ios
複製代碼
下載後一直報錯,最終解決辦法是: 關掉全部終端,打開只打開一個終端,打開到咱們對應的項目,執行npm start 而後在點擊項目下的 ios/test.xcodeproj in Xcodeios
咱們的項目用到了webview,由於在啓動時有warnning,找到文章以下git
使用方法:依次執行下面兩行代碼再次從新啓動
$ yarn add react-native-webview
$ react-native link react-native-webview
複製代碼
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { WebView } from 'react-native-webview';
// ...
class MyWebComponent extends Component {
render() {
return (
<WebView source={{ uri: 'https://facebook.github.io/react-native/' }} />
);
}
}
複製代碼
先檢查如下兩項:github