Home » Android » android – phonegap Class not found at file:///android_asset/www/cordova-2.0.0.js:938

android – phonegap Class not found at file:///android_asset/www/cordova-2.0.0.js:938

Posted by: admin June 15, 2020 Leave a comment


i try to use this plugin and followed the instruction given in the readme.md file.

1)here’s my html file

    <title>TryMakan Video</title>
    <link rel="stylesheet" href="style.css" />
<script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
    <script type="text/javascript" charset="utf-8" src="video.js"></script>
    <script type="text/javascript">
function playVideo(){
</head> <body>
<a href="#" onClick="playVideo();">play</a>

2) here’s my plugins.xml which is located in xml folder

<?xml version="1.0" encoding="utf-8"?>
    <plugin name="VideoPlayer" value="com.phonegap.plugins.video.VideoPlayer"/>

3) i’ve also copied the VideoPlayer.java into this folder src\com\phonegap\plugins\video

4) additionally, some said I also need to add the plugin into AndroidManifest.xml file, so this is a snippet of it

        android:theme="@style/AppTheme" >
            android:label="@string/title_activity_main" >
                <action android:name="android.intent.action.MAIN" />
                <action android:name="com.phonegap.plugins.video.VideoPlayer"/>
                <category android:name="android.intent.category.LAUNCHER" />

but still, when I click on ‘play’, log cat will return this error

08-08 04:54:15.823: I/Web Console(309): Error: Status=2 Message=Class not found at file:///android_asset/www/cordova-2.0.0.js:938

update1: here’s where the VideoPlayer.java is located


I don’t see the VideoPlayer.java under Gen folder, does that means it’s not compiled? Could this be the problem? If yes, how to solve it?

update2: I checked bin folder, and there VideoPlayer.class under bin\classes\com\phonegap\plugins\video so the VideoPlayer.java is actually compiled

How to&Answers:

the problem is your plugins.xml.

it appears in one of the recent PhoneGap release, the plugins.xml has been removed and you have to add the line in res/xml/config.xml instead.

so try adding the tag <plugin name="VideoPlayer" value="com.phonegap.plugins.video.VideoPlayer"/>

to res/xml/config.xml not to plugins.xml


If the error shown in the log is

Class not found at file:///android_asset/www/cordova-2.0.0.js:938

The best way is to check which class is causing the error.
For those who still get this error message, try the following trick.

  1. Open cordova-2.0.0.js in an editor.
  2. Replace code on Line 938 i.e.

    console.log(“Error: Status=”+v.status+” Message=”+v.message);


    console.log(“Error: Status=”+v.status+” Message=”+v.message+” service=”+service+” action=”+action);

  3. Run the app again and check the console for the above error. You can see the plugin which causes the error in service=XYZ where XYZ is the plugin name.

  4. Check if the section in your config.xml file has any entry for the XYZ plugin.
  5. Add the XYZ plugin if not found.


I have had this error because of a missing plugin. I Added

<plugin name="Device" value="org.apache.cordova.Device"/>

to the config.xml file and it fixed it.