简体   繁体   中英

Cordova plugin developement

I currently try developing plugins for cordova. I Already got a simple "echo" plugin working and could install it automatically through cordova plugin install LOCAL_PATH .

Now I want to edit my plugin (specific the .js file) after installation. I read that I have to change the original .js file, because it´s deployed to platform specific folder when executing "cordova prepare". But the .js file in android/assets doesn´t change. When I edit this file direktly it is replaced after "cordova prepare", even when the original .js file does not exists any more.

This is my plugin.xml

...
<asset src="www/myEcho.js" target="js/myEcho.js" />

<!-- android -->
<platform name="android">
    <config-file target="res/xml/config.xml" parent="/*">
        <feature name="MyEcho">
            <param name="android-package" value="com.example.myplugin.MyEcho"/>
        </feature>
    </config-file>

    <source-file src="src/MyEcho.java" target-dir="src/com/example/myplugin" />
</platform>
...

Thanks in advance

PS: According to the documentation the "asset" tag should cause that the myEcho.js file is copied to the top level www folder. That does not happen (but it is copied to the platform specific www folder). Is it a bug or am I doing something wrong?

您可以在LOCAL_PATH文件夹中编辑“ www / MyEcho.js”文件,然后使用“ cordova plugin install LOCAL_PATH”将其重新添加到应用程序中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM