Merge pull request #161 from don/master

Write error to log when plugins.xml is missing
This commit is contained in:
Dave Johnson 2011-07-15 22:03:42 -07:00
commit 4af8952dc3
2 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,4 @@
<!--?xml version="1.0" encoding="utf-8"?--> <?xml version="1.0" encoding="utf-8"?>
<plugins> <plugins>
<plugin name="App" value="com.phonegap.App"/> <plugin name="App" value="com.phonegap.App"/>
<plugin name="Geolocation" value="com.phonegap.GeoBroker"/> <plugin name="Geolocation" value="com.phonegap.GeoBroker"/>

View File

@ -50,6 +50,7 @@ public final class PluginManager {
*/ */
public void loadPlugins() { public void loadPlugins() {
int id = ctx.getResources().getIdentifier("plugins", "xml", ctx.getPackageName()); int id = ctx.getResources().getIdentifier("plugins", "xml", ctx.getPackageName());
if (id == 0) { pluginConfigurationMissing(); }
XmlResourceParser xml = ctx.getResources().getXml(id); XmlResourceParser xml = ctx.getResources().getXml(id);
int eventType = -1; int eventType = -1;
while (eventType != XmlResourceParser.END_DOCUMENT) { while (eventType != XmlResourceParser.END_DOCUMENT) {
@ -297,4 +298,11 @@ public final class PluginManager {
plugin.onNewIntent(intent); plugin.onNewIntent(intent);
} }
} }
private void pluginConfigurationMissing() {
System.err.println("=====================================================================================");
System.err.println("ERROR: plugin.xml is missing. Add res/xml/plugins.xml to your project.");
System.err.println("https://raw.github.com/phonegap/phonegap-android/master/framework/res/xml/plugins.xml");
System.err.println("=====================================================================================");
}
} }