Error in Phonegap Application: Uncaught module cordova/plugin_list already defined

早过忘川 提交于 2019-12-03 04:40:27
grytrn

One cause of this problem is importing the cordova_plugins.js in your html file.

Check if it is the case for you and remove it.

The file cordova.js automatically loads cordova_plugins.js.

So another obvious way to end up with this error is if you inadvertently put the following code twice on your page.

<script type="text/javascript" src="cordova.js"></script> 

I lost hours on this same error only to realise I had added cordova.js at both the top and the bottom of the page.

You must have to create and deploy any phonegap project/application using Phonegap Command Line Interface

To Create any project write following command on command line:

$ phonegap create <path> <package_name> <project_name>

i.e.

$ phonegap create hello com.example.hello HelloWorld

To add any platform to your project:

cd <path_to_project>
$ phonegap build <platform>

i.e.

cd hello
$ phonegap build ios
$ phonegap build android

To add any plugin feature to your project:

cd <path_to_project>
$ phonegap local plugin add <path_to_plugin>

i.e.

cd hello
$ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!