Hi, I have a View subclass that references a class that uses various
things from the org.apache libraries. I'm not sure if this is a bug,
or if I'm not doing someting right.
The code itself compiles fine (I've imported everything I need to
import), but it seems like the Layout Editor can't find these classes.
The visual editor just displays
"ClassNotFoundException:
org.apache.http.client.ClientProtocolException"
It does a similar thing with classes from org.json. This is the stack
trace:
java.lang.ClassNotFoundException:
org.apache.http.client.ClientProtocolException
at
com.android.ide.eclipse.adt.internal.resources.manager.ProjectClassLoader.findClass(Unknown
Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at com.zumobi.adslib.AdView.setup(AdView.java:57)
at com.zumobi.adslib.InterstitialAdView.setup(InterstitialAdView.java:
29)
at com.zumobi.adslib.AdView.<init>(AdView.java:42)
at
com.zumobi.adslib.InterstitialAdView.<init>(InterstitialAdView.java:
19)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(Unknown
Source)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:
198)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:
126)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:296)
at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:377)
at
com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.computeLayout(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.recomputeLayout(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.activated(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.partActivated(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.partBroughtToTop(Unknown
Source)
at org.eclipse.ui.internal.PartListenerList
$2.run(PartListenerList.java:87)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:888)
at
org.eclipse.ui.internal.PartListenerList.fireEvent(PartListenerList.java:
57)
at
org.eclipse.ui.internal.PartListenerList.firePartBroughtToTop(PartListenerList.java:
85)
at
org.eclipse.ui.internal.PartService.firePartBroughtToTop(PartService.java:
208)
at
org.eclipse.ui.internal.WorkbenchPagePartList.firePartBroughtToTop(WorkbenchPagePartList.java:
76)
at
org.eclipse.ui.internal.WorkbenchPagePartList.fireActiveEditorChanged(WorkbenchPagePartList.java:
52)
at org.eclipse.ui.internal.PartList.setActiveEditor(PartList.java:
162)
at
org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor(WorkbenchPage.java:
1281)
at
org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:
3530)
at
org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:
3077)
at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:
279)
at
org.eclipse.ui.internal.EditorPane.requestActivation(EditorPane.java:
98)
at org.eclipse.ui.internal.PartPane.setFocus(PartPane.java:325)
at org.eclipse.ui.internal.EditorPane.setFocus(EditorPane.java:127)
at
org.eclipse.ui.internal.PartStack.presentationSelectionChanged(PartStack.java:
844)
at org.eclipse.ui.internal.PartStack.access$1(PartStack.java:827)
at org.eclipse.ui.internal.PartStack$1.selectPart(PartStack.java:137)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation
$1.handleEvent(TabbedStackPresentation.java:133)
at
org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:
269)
at
org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:
278)
at
org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access
$1(DefaultTabFolder.java:1)
at
org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder
$2.handleEvent(DefaultTabFolder.java:88)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:
2743)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1429)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:
257)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:
3622)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3277)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:
2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:
332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:
663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:
149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:
115)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:
196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:
110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:
79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
369)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
In case you need to know, here's the relevant code from what I've
written:
In com.zumobi.adslib.InterstitialAdView extends
com.zumobi.adslib.AdView:
protected void setup() {
super.setup();
Log.d(TAG, "setup called.");
}
In com.zumobi.adslib.AdView extends View
protected void setup() {
this.setBackgroundColor(0xFFFF0000);
AdManager.getInstance().registerAd(this);
}
in com.zumobi.adslib.AdManager: (This is the class where I import
things from org.apache)
protected void registerAd(AdView ad) {
// add to the currentAds Vector
this.currentAds.add(ad);
}
The code is exceedingly simple, so it's not an error in what I've
written.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en