I'm developing Cordova project using Android Studio. I want to Cordova device plugin to my project. As I understand Cordova plugin consists of device.js
and Device.java
, which I've found in the folder of plugin. I copied Device.java
into CordovaLib/src/org/apache/cordova/device/
folder and device.js
into assets/www/plugins/org.apache.cordova.device/www
folder. I also included into index.html
cordova_plugins.js
file, which was automatically created by Cordova. It has the following content:
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
{
"file": "plugins/org.apache.cordova.device/www/device.js",
"id": "org.apache.cordova.device.device",
"clobbers": [
"device"
]
}
];
module.exports.metadata =
// TOP OF METADATA
{
"org.apache.cordova.device": "0.2.12"
}
// BOTTOM OF METADATA
});
Now when I successfully build my app and run it I get Error initializing Cordova: Class not found
error. What am I doing wrong?