Deviceready did not shoot at phonegap 2.9.0 with sencha touch 2

I use PhoneGap 2.9.0 and SenchaTouch to develop my Android application (targetSdkVersion 16).

When I launch the application in Chrome, I have the following logs:

Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2 and lower only. cordova.js:912 deviceready has not fired after 5 seconds. cordova.js:6725 Channel not fired: onCordovaConnectionReady cordova.js:6718 Channel not fired: onCordovaInfoReady cordova.js:6718 

When I test it on a Samsung tablet (Android 4.1.2), the first line disappeared, but 3 events do not always fire.

However, it seems SenchaTouch is working quite well: views and interactions are displayed as I expect.

Here is the chapter in the index.html section:

  <head> <meta charset="UTF-8"> <title>title</title> <!-- The line below must be kept intact for Sencha Command to build your application --> <script id="microloader" type="text/javascript" src="touch/microloader/development.js"></script> <style type="text/css"> some css here </style> <script type="text/javascript" charset="utf-8" src="pg/cordova.js"></script> <script type="text/javascript" charset="utf-8" src="pg/barcodescanner.js"></script> </head> 

I use some phone APIs such as Camera and File. Since PhoneGap does not receive the deviceready event, the API is not available, therefore navigator.camera is undefined.

I did a hug study, but everything I tested does not solve the problem. Any tips are welcome. Thanks in advance.

+4
source share
5 answers

Had the same problem, but in my case it was due to the fact that I was referring to plugins in my config.xml file that I did not create in my application.

Just commenting on them until I name them in my code, I immediately confirmed that "Phonegap is ready."

Thank you for: http://community.phonegap.com/nitobi/topics/deviceready_has_not_fired_after_5_seconds

+5
source

I recommend you try with pure non-sencha html, just keep track of if the cames error from sencha or phonegap

0
source

The problem is with hard-coded time when loading URLs. This timeout occurs because the page size created by Sencha Touch cannot be calculated. Unfortunately, I cannot find the resources that I used to solve this problem in the past, so correct me if I am wrong, but my solution was to create an html file redirected to the actual index.html.

 <!DOCTYPE html> <!-- Launch the generated index.html file to prevent Cordova/PhoneGap timeouts --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>AppName</title> <script> window.location = './index.html'; </script> </head> <body></body> </html> 
0
source

According to the iOS 8 Beta 1 release notes (WebKit section), this is a known issue that Cordova / Phonegap applications are currently broken due to a user agent error.

Applying this temporary fix fixed my problems with the deviceready event that was not triggered.

fooobar.com/questions/1194818 / ...

0
source
 you need to include cordova plugin before closing of body tag, as follows <!doctype html> <html> <head> </head> <body> <script src='cordova.js' type='text/javascript'></script> <script src='index.js' type='text/javascript'></script> </body> </html> 
0
source

Source: https://habr.com/ru/post/1493231/


All Articles