2016-04-08 4 views
2

Androidで動作するCordovaアプリは、iosでフリーズしているようです。 iOSプラグインバージョン4.1.1を使用するCordovaのバージョン6.1。アプリケーションはAndroidエミュレータとデバイスで正常に動作します。AndroidでCordovaアプリが動作していますが、スレッドがフリーズしているようです。「ページの読み込みによるプラグインのリセット」

XCodeアプリからデバイスで実行していると、読み込み中のようです。ホーム画面はうまく表示されますが、電話機のホームボタンを押していない限り、devicereadyイベントの後に表示されるconsole.logステートメントは表示されません。その後、SQLite DBに接続する最初のいくつかの関数のすべてのコンソールログステートメントが一度に表示されます。使用中の

プラグイン:

  • コルドバ - プラグインのコンソール
  • コルドバ-sqliteのストレージ
  • flyacts-プラグインbarcodescanner

私は再度ランチャーのアイコンをタップすることができますアプリと対話しますが、ホームボタンをもう一度押すまで、コンソールには何も表示されません。ホームボタンを押して実行させる前に、複数のDBトランザクションまたはバーコードスキャナへの呼び出しをキューに入れることはできません。

devicereadyの後に呼び出されるconsole.logメッセージは表示されませんが、アプリケーション内のナビゲーションが機能するため、アプリケーション内のナビゲーションを実行するコードは実行されます。プラグインが止められているようだ。

サンプルコード:コンソールの

var app ={ 
    init: function(){ 
    document.addEventListener("deviceready", app.onDeviceReady); 
    }, 
    onDeviceReady: function(ev){ 
    console.log("device ready"); //this does NOT appear in the console 
    //add some click listeners to buttons for navigation 
    //and this code DOES run 
    console.log("another test message"); //does NOT appear 
    app.setUpDB(); 
    }, 
    setUpDB: function(){ 
    console.log("setting up DB"); //this does NOT appear in console 
    //code to open DB and create tables 
    //this code will not run until after the home button clicked 
    }, 
    ... more functions ... 
} 
app.init(); 
console.log("this won't appear before home button click"); 

メッセージホームボタンを

2016-04-08 08:35:42.900 MeetCute-MadLib[387:141553] Apache Cordova native platform version 4.1.1 is starting. 
2016-04-08 08:35:42.903 MeetCute-MadLib[387:141553] Multi-tasking -> Device: YES, App: YES 
2016-04-08 08:35:43.000 MeetCute-MadLib[387:141553] Using UIWebView 
2016-04-08 08:35:43.005 MeetCute-MadLib[387:141553] [CDVTimer][handleopenurl] 0.510991ms 
2016-04-08 08:35:43.012 MeetCute-MadLib[387:141553] [CDVTimer][intentandnavigationfilter] 5.966008ms 
2016-04-08 08:35:43.012 MeetCute-MadLib[387:141553] [CDVTimer][gesturehandler] 0.219047ms 
2016-04-08 08:35:43.012 MeetCute-MadLib[387:141553] [CDVTimer][TotalPluginStartup] 8.069038ms 
2016-04-08 08:35:43.451 MeetCute-MadLib[387:141553] Resetting plugins due to page load. 
2016-04-08 08:35:43.807 MeetCute-MadLib[387:141553] Finished load of: file:///var/containers/Bundle/Application/2DC8233D-0BA4-4BE9-8689-53D492193E64/MeetCute-MadLib.app/www/index.html 

そして、ホームボタンをクリックして...とすぐにクリックする前に、このの残りが表示されます

2016-04-08 08:48:58.538 MeetCute-MadLib[391:143286] Initializing SQLitePlugin 
2016-04-08 08:48:58.538 MeetCute-MadLib[391:143286] Detected docs path: /var/mobile/Containers/Data/Application/10EE751F-CE70-449E-800D-817371C9813E/Documents 
2016-04-08 08:48:58.539 MeetCute-MadLib[391:143286] Detected Library path: /var/mobile/Containers/Data/Application/10EE751F-CE70-449E-800D-817371C9813E/Library 
2016-04-08 08:48:58.539 MeetCute-MadLib[391:143286] no cloud sync at path: /var/mobile/Containers/Data/Application/10EE751F-CE70-449E-800D-817371C9813E/Library/LocalDatabase 
2016-04-08 08:48:58.540 MeetCute-MadLib[391:143286] device is ready 
2016-04-08 08:48:58.540 MeetCute-MadLib[391:143286] tagname a 
2016-04-08 08:48:58.540 MeetCute-MadLib[391:143286] test the sqlitePlugin 
2016-04-08 08:48:58.540 MeetCute-MadLib[391:143286] set up DB 
2016-04-08 08:48:58.540 MeetCute-MadLib[391:143345] open full db path: /var/mobile/Containers/Data/Application/10EE751F-CE70-449E-800D-817371C9813E/Library/LocalDatabase/DBmeetcute 
2016-04-08 08:48:58.584 MeetCute-MadLib[391:143286] THREAD WARNING: ['Console'] took '43.607910' ms. Plugin should use a background thread. 
2016-04-08 08:48:58.589 MeetCute-MadLib[391:143286] about to openDatabase 
2016-04-08 08:48:58.589 MeetCute-MadLib[391:143286] OPEN database: DBmeetcute 
2016-04-08 08:48:58.589 MeetCute-MadLib[391:143286] database already open: DBmeetcute 
2016-04-08 08:48:58.590 MeetCute-MadLib[391:143286] create the tables IF NOT EXISTS 
2016-04-08 08:48:58.590 MeetCute-MadLib[391:143286] new transaction is waiting for open operation 
2016-04-08 08:48:58.590 MeetCute-MadLib[391:143286] fetching profile 
2016-04-08 08:48:58.590 MeetCute-MadLib[391:143286] new transaction is waiting for open operation 
2016-04-08 08:48:58.596 MeetCute-MadLib[391:143345] Good news: SQLite is thread safe! 
2016-04-08 08:48:59.237 MeetCute-MadLib[391:143286] DB opened: DBmeetcute 

答えて

1

@ prof3ssorSt3v3 index.htmlのコピーを手に入れることができました。 CSPは、JSとネイティブ側が通信することを可能にするgap:が見つからなかったため、間違っていました。だからあなたがこのようなものに遭遇しているのであれば、index.htmlのCSPタグをチェックしてください。

<meta http-equiv="Content-Security-Policy" 
    content="default-src 'self' data: gap: https://ssl.gstatic.com 
    'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *"> 
+0

ありがとうサイモン。知っておいてよかった。 – prof3ssorSt3v3

関連する問題