[
https://issues.apache.org/jira/browse/CB-5075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13854020#comment-13854020
]
Marcel Kinard commented on CB-5075:
-----------------------------------
Those popups are coming from the real cordova.js trying to execute native
plugins by sending special messages through the prompt bridge. If you are
running in a desktop browser, there are no native plugins present, and the
prompt bridge doesn't intercept those messages, so they appear as alerts popups
in the desktop browser. I had a similar experience when our product upgraded
from Cordova 2.6 to 3.1. Hitting Cancel for all the popups was the workaround
we used for a while.
I believe the change occurred in Cordova 3.0, when the cordova.js started
executing some code upon load instead of just defining functions and vars (look
at the bootstrap invocations in the last few lines of cordova.js). So as soon
as cordova.js is loaded, it tries to initialize things and call native plugins
via messages, which is why you are now seeing these popups - those are the raw
messages intended for the native code.
I haven't looked enough at Ripple to understand how it hooks in, but in my
previous experience when we wanted to use a Cordova simulator with 3.0+ we
needed to comment out the script tag in our html app that loaded the real
cordova.js and replace it with the load of our simulator's js. (This was with a
simulator other than Ripple.) Before 3.0 we could leave both in our html app,
load the simulator immediately after the real cordova.js, and the simulator
would overwrite the definitions of the real cordova.js. But now that cordova.js
is executing code as soon as it loads, before the simulator gets a chance to
overwrite the definitions, the real code gets invoked upon bootstrap instead of
the simulator. So my conclusion was that if you intend to run with a simulator,
you can't load the real cordova.js in your app. I don't know if Ripple has
special handling that should make this transparent. But this is why you are
seeing the change in behavior between 2.2 and 3.2.
> Ripple Emulator does not work with Cordova 3.1.0
> ------------------------------------------------
>
> Key: CB-5075
> URL: https://issues.apache.org/jira/browse/CB-5075
> Project: Apache Cordova
> Issue Type: Bug
> Components: CordovaJS, Plugin File, Plugin Geolocation
> Affects Versions: 3.1.0
> Environment: Mac OSX, Ripple Emulator (Beta) 0.9.15, Chrom Version
> 30.0.1599.69
> Reporter: Sebastian Zillessen
> Priority: Minor
>
> If I try to run a application in the Ripple Emulator I get a lot of alerts
> with failing Plugins initializations:
> gap:["PluginManager","startup","PluginManager9697043"]
> gap:["App","show","App9697044"]
> gap:["Device","getDeviceInfo","Device9697045"]
> gap:["NetworkStatus","getConnectionInfo","NetworkStatus9697046"]
> If I hit "Cancel" the application starts, but without any plugins available.
> If I hit "OK" in one of this windows the application freezes and I get a lot
> of logs in the debuggin are of chrome saying
> {code}
> processMessage failed: invalid message:
> {code}
> Installed Plugins:
> {code}
> [ 'org.apache.cordova.device',
> 'org.apache.cordova.dialogs',
> 'org.apache.cordova.geolocation',
> 'org.apache.cordova.network-information',
> 'org.apache.cordova.vibration' ]
> {code}
> Application was build with cordova's CLI.
> It is served with
> {code}
> cordova serve android
> {code}
> I access the application in Chrome via
> http://localhost:8000/android/www/index.html?enableripple=cordova-2.0.0
> In my console I see:
> {code}
> Console was cleared ripple.js:37
> Ripple :: Environment Warming Up (Tea. Earl Gray. Hot.) ripple.js:37
> cordova :: Your application does not appear to match the platform you have
> selected. The version number in your configuration might not match the
> selected platform version or your configuration file has errors in it.
> ripple.js:37
> cordova :: Initialization Finished (Make it so.) ripple.js:37
> Uncaught TypeError: Cannot call method 'fire' of undefined
> POST
> https://rippleapi.herokuapp.com/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rurl=http%3A//debug.phonegap.com/ws/target
> 500 (Internal Server Error)
> rippleapi.herokuapp.com/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rurl=http%3A//debug.phonegap.com/ws/target:1
> Uncaught TypeError: Cannot call method 'call' of undefined
> target-script-min.js:1053
> deviceready has not fired after 5 seconds. cordova.js:1095
> Channel not fired: onCordovaInfoReady cordova.js:1088
> Channel not fired: onCordovaConnectionReady
> {code}
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)