Ionic3最新坑記錄[持續(xù)更新]

1.錯(cuò)誤信息:Camera.getPicture: source type 1 not available.

解決方案:在ionic3以后的版本,使用camera插件時(shí),options中的圖片來(lái)源類型,不能用0或1了,需要用枚舉表示。

var sourceType;
if (index == 1) {
  sourceType = this.camera.PictureSourceType.CAMERA;
} else if(index == 0){
  sourceType = this.camera.PictureSourceType.PHOTOLIBRARY;
}
var options = {
  ...
  sourceType: sourceType,// PHOTOLIBRARY = 0  CAMERA = 1  SAVEDPHOTOALBUM = 2
};

this.camera.getPicture(options).then((imageData) => {
  ///uploading...
})

2.錯(cuò)誤信息:Archive Upload Successful 成功,但是iTunes不顯示構(gòu)建版本。

解決方案:在使用了cordova調(diào)用設(shè)備api,要在.info.plist中加入對(duì)應(yīng)的權(quán)限提示。

麥克風(fēng)權(quán)限:Privacy - Microphone Usage Description 是否允許此App使用你的麥克風(fēng)?
相機(jī)權(quán)限: Privacy - Camera Usage Description 是否允許此App使用你的相機(jī)?
相冊(cè)權(quán)限: Privacy - Photo Library Usage Description 是否允許此App訪問(wèn)你的媒體資料庫(kù)?
通訊錄權(quán)限: Privacy - Contacts Usage Description 是否允許此App訪問(wèn)你的通訊錄?
藍(lán)牙權(quán)限:Privacy - Bluetooth Peripheral Usage Description 是否許允此App使用藍(lán)牙?
語(yǔ)音轉(zhuǎn)文字權(quán)限:Privacy - Speech Recognition Usage Description 是否允許此App使用語(yǔ)音識(shí)別?
日歷權(quán)限:Privacy - Calendars Usage Description 是否允許此App使用日歷?
定位權(quán)限:Privacy - Location When In Use Usage Description 我們需要通過(guò)您的地理位置信息獲取您周邊的相關(guān)數(shù)據(jù)
定位權(quán)限: Privacy - Location Always Usage Description 我們需要通過(guò)您的地理位置信息獲取您周邊的相關(guān)數(shù)據(jù)

3.ionic3打包iOS包使用xcode build時(shí)報(bào)錯(cuò):

duplicate symbol OBJC_CLASS$_CDVLogger in..

linker command failed with exit code 1 (use -v to see invocation)

解決方案

ionic cordova platform rm ios
ionic cordova platform add ios@4.4.0

4. 隱藏ionic3啟動(dòng)界面的小菊花

解決方案:在config.xml增加如下配置:

<preference name="ShowSplashScreenSpinner" value="false" />

5.ionic使用WKWevView后出現(xiàn)跨域請(qǐng)求:

{"_body":{"isTrusted":true},"status":200,"statusText":"Ok","headers":{},"type":3,"url":null}"

解決方案:強(qiáng)制cordova使用默認(rèn)引擎(UIWebView),參考資料:https://ionicframework.com/docs/wkwebview/

<preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" />

5.Ionic build android, Error: spawn EACCES

解決方案:https://github.com/ionic-team/ionic-cli/issues/2176

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

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

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