Uncaught ReferenceError: cordova is not defined

后端 未结 2 1926
暗喜
暗喜 2021-02-14 11:09

This is my HelloPlugin.js file.

var HelloPlugin = { 
  callNativeFunction: function(success,fail,resultType) { 
    return cordova.exec(success, fail, \"HelloPlu         


        
相关标签:
2条回答
  • 2021-02-14 11:11

    I had a similar issue in iOS. The solution was to install cordova-plugin-file-transfer2:

    cordova plugin add cordova-plugin-file-transfer
    
    0 讨论(0)
  • 2021-02-14 11:18

    Pleas make sure you have <script ... tag for cordova.js before <script ... tag for HelloPlugin.js in your HTML file.

    It should have both in the <head> tag like this:

    <script src="cordova.js"></script>
    <script src="HelloPlugin.js"></script>
    
    0 讨论(0)
提交回复
热议问题