Cordova – In Android Phonegap “Unable to run constructor: ReferenceError: Unfained PLUGINMANAGER”

How to stop running the constructor failed: ReferenceError: PluginManager is not defined error in PhoneGap in Android?
In PhoneGap version 1.0, they changed the plug-in mechanism.

Add The old method of the plugin is in the PhoneGap.addConstructor section of the javascript file of the plugin.

You will have something similar

PhoneGap.addConstructor(function() {
PhoneGap.addPlugin('analytics', new Analytics());
PluginManager.addService("GoogleAnalyticsTracker", "com.phonegap.plugins.analytics.GoogleAnalyticsTracker");
}) ;

However, in the newer version, you can now perform the addService step in the res/xml/plugins.xml file.

So in my case, I use The one is the Google Analytics plugin that is still using the old method. It doesn’t seem to do any harm because I think it will be ignored. However, if you want to eliminate the error, just comment out the PluginManager.addService(… ..) line.

How to stop running the constructor failed: ReferenceError: PluginManager is not defined error in PhoneGap in Android?

In the 1.0 version of PhoneGap, they changed the plugin mechanism.

The old way to add plugins is in PhoneGap of the plugin’s javascript file .addConstructor section.

You will have something similar

PhoneGap.addConstructor(function() {
PhoneGap.addPlugin('analytics' , new Analytics());
PluginManager.addService("GoogleAnalyticsTracker", "com.phonegap.plugins.analytics.GoogleAnalyticsTracker");
});

However, in comparison In the new version, you can now perform the addService step in the res/xml/plugins.xml file.

So in my case, I am using the Google Analytics plugin which is still using the old method. It doesn’t seem to do any harm because I think it will be ignored. However, if you want to eliminate the error, just comment out the PluginManager.addService(…..) line in the analytics.js file.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3746 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.