gpt4 book ai didi

android - HListView 无法实例化 Android Eclipse 项目库

转载 作者:行者123 更新时间:2023-11-29 17:54:50 25 4
gpt4 key购买 nike

该库包含一个演示项目,我试过了并且效果很好。现在,当我在我的项目中导入库时,我在布局文件中添加了:

<it.sephiroth.android.library.widget.HListView
android:id="@+id/hListView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/ImageView01"
android:layout_marginTop="19dp" >
</it.sephiroth.android.library.widget.HListView>

它与演示中的几乎相同,当我转到图形布局选项卡时出现以下错误。

    eclipse.buildId=v22.0.5-757759triedm
java.version=1.6.0_27
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product com.android.ide.eclipse.adt.package.product
Command-line arguments: -os linux -ws gtk -arch x86 -product com.android.ide.eclipse.adt.package.product

Error
Tue Nov 26 13:25:53 EET 2013
it.sephiroth.android.library.widget.HListView failed to instantiate.

java.lang.IllegalStateException: Cannot find resource 'hlv_overscroll_edge'
at it.sephiroth.android.library.widget.EdgeEffect.<init>(EdgeEffect.java:144)
at it.sephiroth.android.library.widget.AbsHListView.setOverScrollMode(AbsHListView.java:697)
at android.view.View.<init>(View.java:3237)
at android.view.View.<init>(View.java:3295)
at android.view.ViewGroup.<init>(ViewGroup.java:427)
at it.sephiroth.android.library.widget.AdapterView.<init>(AdapterView.java:224)
at it.sephiroth.android.library.widget.AbsHListView.<init>(AbsHListView.java:630)
at it.sephiroth.android.library.widget.HListView.<init>(HListView.java:151)
at it.sephiroth.android.library.widget.HListView.<init>(HListView.java:147)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:422)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:179)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:746)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:718)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:372)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:383)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:332)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:325)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderService.createRenderSession(RenderService.java:440)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(GraphicalEditorPart.java:1545)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(GraphicalEditorPart.java:1302)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ReloadListener.reloadLayoutSwt(GraphicalEditorPart.java:1777)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ReloadListener.access$0(GraphicalEditorPart.java:1715)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ReloadListener$1.run(GraphicalEditorPart.java:1709)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3537)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3189)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
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:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

我尝试重新启动/清理,检查路径;但没有任何效果。可能是什么问题?或者我应该如何研究演示项目,使其与我的相似,以便它能正常工作?


更新

这是我的布局:http://pastebin.com/L7d5idwE

最佳答案

我在这个库中遇到了同样的异常。在我的例子中,我使用 aapt--rename-manifest-package 选项重命名我的 list 包。这导致 HListViewEdgeEffect 类无法找到所需的资源,因为 Resources#getIdentifier(String,String,String)需要原始包名来加载标识符,而不是重命名的包名。我已经提交了 pull request解决这个问题。

关于android - HListView 无法实例化 Android Eclipse 项目库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20215996/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com