[Cordova] cannot compile native code problem scenario for plugin copy in Visual Studio project
When developing Cordova plugin, the process of development should be:
- Establishment of Cordova Plugin
- Publish to a native file system or a git server
- Mount plugin using Visual Studio
- Compiling and executing the project
In this development process, if you compile and execute this step of the project, you find that plugin's native code needs to be corrected. The intuitive idea is to modify the native code of the plugin copy in the Cordova project directly, then recompile and execute the project to see if the changes are correct. In this case, the modification will not be compiled and executed when the plugin copy of native Code is modified and the project is recompiled. (The same result will be if the project is cleared again)
Solution Solutions
After troubleshooting various operating methods, it is speculated that the cause of the above problems, should be Cordova in order to shorten the compile time, plugin inside the native code only when necessary to compile. This action of modifying plugin copy native code, in the current version (14.0.50925.4), is clearly not defined as the scope that needs to be detected and recompiled.
Once you know the cause of the problem, the solution is simple. Since this action of modifying the plugin copy native code does not trigger recompilation, delete the compiled results of the Cordova: "platforms folder", forcing the Cordova to recompile the project, so that the modified native Code is recompiled by Cordova.
[Cordova] cannot compile native Code for plugin copy in Visual Studio project