Android无法使用支持v7(Android cannot use support v7)

编程入门 行业动态 更新时间:2024-10-20 16:17:17
Android无法使用支持v7(Android cannot use support v7)

在Demo下它显示Demo The hierarchy of the type Demo is inconsistent ,在RecyclerView下它显示了The type android.support.v4.view.ScrollingView cannot be resolved 。 它是从所需的.class文件间接引用的。 我该如何解决这个问题?

public class Demo extends RecyclerView { public Demo(Context context, AttributeSet attrs) { super(context, attrs); } }

under Demo it shows The hierarchy of the type Demo is inconsistent, under RecyclerView it shows The type android.support.v4.view.ScrollingView cannot be resolved. It is indirectly referenced from required .class files. How do I resolve this?

public class Demo extends RecyclerView { public Demo(Context context, AttributeSet attrs) { super(context, attrs); } }

最满意答案

我也有同样的问题。 为了解决这个问题,我检查了Android支持库的变化并搜索了添加了NestedScrollingChild的版本。

该版本是Android支持库,修订版22。1。0(2015年4月)

知道问题后,请按照下列步骤操作:

从您的项目和工作空间中删除所有支持库(先做代码备份!)

在您的工作区中再次导入您上次修订时使用的支持库(android-support-v7-appcompat)

转到导入的库v7的libs目录并删除android-support-v4.jar ”文件。

右键点击工作区中导入的项目库。 选择“Android工具”,然后点击“添加支持库...”

Whait进程完成了。

转到您的项目属性,Android,在底部单击添加,选择android-support-v7-appcompat,单击以应用。 清洁项目。

左键单击您的项目,属性,Java Build Path,库

点击“添加JAR ..”。

转到android-support-v7-appcompat项目,libs目录,然后选择android-support-v4.jar文件。 单击确定。

再次点击确定。 清洁项目。

它应该工作。

如果你遇到麻烦,请评论。

PD:对不起,我的英语;)

I have the same problem. To resolve this, I check the android support library changes and search in what version is added the NestedScrollingChild.

The version is Android Support Library, revision 22.1.0 (April 2015)

After known the problem, follow this steps:

Remove all support library from your project and your workspace (do code backup before!)

Import in your workspace again the support library (android-support-v7-appcompat) you ned with the last revision

Go to libs directory of your library v7 imported and delete the "android-support-v4.jar" file.

Right click to the project library imported in your workspace. Select "Android Tools" and then click to "Add support library..."

Whait process get finished.

Go to your project properties, Android, at the bottom click add, select android-support-v7-appcompat, click to Apply. Clean project.

Left click to your project, properties, Java Build Path, libraries

Click "Add JARs.."

Go to android-support-v7-appcompat project, libs directory, and select android-support-v4.jar file. Click OK.

Click ok again. Clean project.

It should work.

Comment if you have some trouble.

PD: Sorry for my english ;)

更多推荐

本文发布于:2023-08-01 02:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1353768.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Android   support

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!