简体   繁体   English

错误:升级Android SDK工具后,“找不到以下类:-android.support.v7.widget.GridLayout”

[英]Error: “The following classes could not be found: - android.support.v7.widget.GridLayout” after upgrading Android SDK Tools

An app has been using android.support.v7.widget.GridLayout for a while without any problem. 应用程式使用android.support.v7.widget.GridLayout已有一段时间,没有任何问题。 I upgraded Android SDK Tools to 22.0.1 this morning. 我今天早上将Android SDK工具升级到22.0.1。 Now, it seems that the app cannot see the library anymore. 现在,该应用似乎不再能看到该库。 The Java code has the following error: Java代码具有以下错误:

The import android.support.v7.widget cannot be resolved

I tried to add a GridLayout to a dummy layout file by dropping GridLayou to it thinking this would help configure the project properly for using GridLayout. 我试图通过将GridLayou放到虚拟布局文件中来将GridLayout添加到虚拟布局文件,认为这将有助于正确配置项目以使用GridLayout。 However, this generates the following error: 但是,这会产生以下错误:

The following classes could not be found:
- android.support.v7.widget.GridLayout

I have restarted Eclipse multiple times and cleaned all projects. 我已经多次重启了Eclipse并清理了所有项目。 Gridlayout_v7.jar is under Android Dependencies and the path is correct. Gridlayout_v7.jar位于Android依赖关系下,并且路径正确。

What should I do to repair the configuration of the project so that android.support.v7.widget.GridLayout can be used? 我应该怎么做才能修复项目的配置,以便可以使用android.support.v7.widget.GridLayout?

Computer OS: Windows 8 Pro 电脑操作系统:Windows 8 Pro

CPU: Intel i5 CPU:Intel i5

Eclipse (Version: Juno Service Release 2): Build id: 20121004-1855 Eclipse(版本:Juno Service Release 2):内部版本:20121004-1855

显然,您没有包含从项目中引用的GridLayout的Android库项目,这可能是因为旧的引用现在已损坏。

Edit you project's (and library project's too) .classpath file like this: 像这样编辑项目的(以及库项目的).classpath文件:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" path="gen"/>
    <classpathentry kind="output" path="bin/classes"/>
</classpath>

It probably updated your default support v4 lib and now the on in your projetc/lib folder is probably a different version from the one inside v7. 它可能更新了您的默认支持v4 lib,现在projetc / lib文件夹中的on可能是与v7内部版本不同的版本。

Delete the support v4 jar file in your project/lib folder. 删除您的project / lib文件夹中的support v4 jar文件。

You can have it there and work with the support v7 lib, but v7 already has a v4 lib and they must have the same version to work. 您可以在那里安装它并使用支持v7库,但是v7已经具有v4库,并且它们必须具有相同的版本才能工作。

Remove the v4 jar file in your lib folder, then add the v7. 删除您的lib文件夹中的v4 jar文件,然后添加v7。

Important Change 重要变化

It has been removed as of API 25.0.0: 自API 25.0.0起已将其删除:

You should replace android.support.v7.widget.Space with android.support.v4.widget.Space 您应该将android.support.v7.widget.Space替换为android.support.v4.widget.Space


See here 这里

android.support.v7.widget.Space has been removed. android.support.v7.widget.Space已被删除。 Usages should be replaced with android.support.v4.widget.Space. 用法应替换为android.support.v4.widget.Space。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 android.support.v7.widget.GridLayout无法实例化 - android.support.v7.widget.GridLayout failed to instantiate 找不到以下类: - android.support.v7.widget.RecyclerView - The following classes could not be found: - android.support.v7.widget.RecyclerView 如何修复 Java 中的“找不到以下类:-android.support.v7.widget.Toolbar”错误 - How to fix 'The following classes could not be found: - android.support.v7.widget.Toolbar' error in Java NoActionBar主题的渲染问题。 找不到以下类:android.support.v7.widget.AppCompatTextView - Rendering Problems with NoActionBar Theme. The following classes could not be found: android.support.v7.widget.AppCompatTextView 无法实例化以下类: - android.support.v7.widget.Toolbar - The following classes could not be instantiated: - android.support.v7.widget.Toolbar 错误无法实例化以下类:- android.support.v7.widget.CardView(打开类,显示错误日志) - Error The following classes could not be instantiated: - android.support.v7.widget.CardView (Open Class, Show Error Log) xml 布局错误:找不到以下类:- android.support.v4.view.Viewpager - Error in xml layout:The following classes could not be found: - android.support.v4.view.Viewpager Eclipse-无法实例化以下类:-android.support.v7.widget.RecyclerView - Eclipse-The following classes could not be instantiated: - android.support.v7.widget.RecyclerView 无法实例化以下类,android.support.design.widget.FloatingActionButton - The following classes could not be instantiated,android.support.design.widget.FloatingActionButton 以下类无法实例化android.support.design.widget.floatingactionbutton - the following classes could not be instantiated android.support.design.widget.floatingactionbutton
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM