我正在尝试将我现有的应用程序从Cordova 4.x升级到Cordova 5.4。 我在过去更新它没有问题,但这一次,当我尝试启动我的应用程序时,我看到以下错误:
"Uncaught ReferenceError: google is not defined"我的声明在我的index.html中保持不变,这接近调用我的JS声明。 任何想法?
<script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="lib/sencha-touch/sencha-touch-all.js"></script> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&sensor=false&libraries=geometry"></script>我验证了我的config.xml和正确的cordova.js被复制到我的Android应用程序的/www目录中(按照之前发布的解决方案),但仍然出现此错误。 同样升级的应用程序在iOS上运行良好,具有所有Google地图功能。
I'm trying to upgrade my existing app from Cordova 4.x to Cordova 5.4. I've had no problem updating it in the past, but this time, I'm seeing the following error when I try to startup my app:
"Uncaught ReferenceError: google is not defined"My declaration remains unchanged in my index.html and this is near the top of call my JS declarations. Any idea?
<script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="lib/sencha-touch/sencha-touch-all.js"></script> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&sensor=false&libraries=geometry"></script>I verified that my config.xml and the correct cordova.js is being copied into the /www directory of my Android app (per an earlier posted soln), but still get this error. The same upgraded app works fine on iOS with all the Google Maps functionality.
最满意答案
对于Android的Cordova 4.0.0+,你必须安装cordova-whitelist-plugin并将其添加到你的config.xml:
<access origin="*" /> <!-- Wildcards are allowed for the protocol, as a prefix to the host, or as a suffix to the path --> <allow-intent href="https://*.example.com/*" /> <allow-navigation href="*://*/*" />It seems with Cordova 4.0.0+ for Android you have to install the cordova-whitelist-plugin and add this to your config.xml:
<access origin="*" /> <!-- Wildcards are allowed for the protocol, as a prefix to the host, or as a suffix to the path --> <allow-intent href="https://*.example.com/*" /> <allow-navigation href="*://*/*" />更多推荐
js,app,应用,程序,Cordova,电脑培训,计算机培训,IT培训"/> <meta name="descript
发布评论