問題是,device
還沒有準備好,永遠不會在之下的ios仿真器。Cordova&Ionic on ios - 設備插件無法正常工作
科爾多瓦的設備插件正確初始化對象device
,但device.ready
總是假,加上各個領域爲空。這意味着該插件沒有被初始化,並且事件不會被觸發,也無法使用$ionicPlatform.ready(...)
方法(正確導入,使用['ionic']
依賴項並使用["$ionicPlatform", function($ionicPlatform)]
注入到控制器中)。
到目前爲止,我已經嘗試了幾次重建,增加了插件幾次,ionic prepare
以及更多的東西,但沒有任何工作。
在Xcode的輸出我得到以下錯誤:
2016-09-27 11:55:15.738 MyApp[74125:12496643] ERROR: Plugin 'Device' not found, or is not a CDVPlugin. Chech your plugin mapping in config.xml.
2016-09-27 11:55:15.738 MyApp[74125:12496643] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = ["Device330720986", "Device", "getDeviceInfo", []]
2016-09-27 11:55:15.738 MyApp[74125:12496643] ERROR: Plugin 'StatusBar' not found, or is not a CDVPlugin. Chech your plugin mapping in config.xml.
2016-09-27 11:55:15.738 MyApp[74125:12496643] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = ["StatusBar330720987", "StatusBar", "_ready", []]
我懷疑這最後的_ready
有事情做與deviceready
不會被觸發。
Android /波紋
在Android下已經過測試,效果很好。在波紋下也給出了很好的迴應。
那麼,你認爲這可能是什麼問題?我一直在網絡上漫遊堆棧溢出和其他地方,我還沒有看到任何結果嘗試共同的解決方案。
隨時問我更多的數據。
呀,不知何故它的工作原理,也發佈了'離子鉤加ios'加不做'sudo chmod -R 777 *',所以現在工作! – SigmaSoldier