Closed seion999 closed 8 years ago
I have the same problem about this. Does anyone have solution about this?
Here are my error message which cordova.js occurs:
deviceready has not fired after 5 seconds. Channel not fired: onCordovaConnectionReady Channel not fired: onCordovaInfoReady
Thanks a lot!
EDIT: I got the problem. the script cordova.js should include with "cordova.js" in index.html but the plugin replace it to "android_asset/www/cordova.js"
Please tell me the occurrence conditions. android version, cordova version, browser type, etc...
derek82511 Kindly share how you solved this issue it is really giving me a headache tkyaji Much Thanks for the plugin seion999 Did you find a solution??
I apologize for this late reply.
I thank tkyaji and everyone for your amazing help. I'd really appreciate it.
Hi, shariajoe, I do not find any solution.
At the time I opened this thread, I tried hard to take care the problem. But now, I'm afraid I gave up this problem-solving.
seion999 Thanks for responding i just started on this, let me keep on brainstorming i'll alert should I find a solution
Just do not encrypt and decrypt your cordova.js file. You can skip encrypt and decrypt it in your hooks file and DecryptResource.java
Hope this help !
Thanks, derek82511.
I have tried your help. Unfortunately, the result is the same: cordova-plugin-device doesn't work.
My developing environment is that: Android 4.4.2 Cordova version 5.1.1 No use of crosswalk
Hi seion999,
did you find a solution ?
Hi vincentFA,
No, I didn't. This plugin doesn't work on Android os, but, it will work well on iOS because I have checked the correct behavior of it using iOS simulator in xcode7.
Hi seion999,
I find a solution, but may be not safe. Are you still interessted ?
Vincent
THX, Vincent, I have interest with your solution. Your solution will help everyone understand Cordova plugin.
So edit the file \platforms\android\CordovaLib\src\org\apache\cordova\CordovaBridge.java
and coment some lines :
else if (defaultValue != null && defaultValue.startsWith("gap_init:")) {
// Protect against random iframes being able to talk through the bridge.
// Trust only pages which the app would have been allowed to navigate to anyway.
//if (pluginManager.shouldAllowBridgeAccess(origin)) {
// Enable the bridge
int bridgeMode = Integer.parseInt(defaultValue.substring(9));
jsMessageQueue.setBridgeMode(bridgeMode);
// Tell JS the bridge secret.
int secret = generateBridgeSecret();
return ""+secret;
//} else {
// Log.e(LOG_TAG, "gap_init called from restricted origin: " + origin);
//}
//return "";
}
return null;
}
}
Not sure this is safe
THX, vincentFA,
I have tried checking the plugin after implementing your solution. Then, the plugin works well on Android.
I think your idea is an excellent one.
Thank you very much for cordova-plugin-crypt-file. I have encrypted files(.html, .htm, .js, .css) and run my application.
But, setting up cordova-plugin-device into my application, cordova-plugin-device doesn't work. My cordova version is 5.1.1.
I would appreciate if you could advice this comment. Thank you in advance.