本文介绍了ENUM类型不是一般性错误克隆andengine的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我一直在AndEngine项目克隆一个仓库后,收到此错误。

Here is the class where the error persists.

package org.andengine.util.spatial.adt.bounds; //The error points at the beginning of this line.
import org.andengine.util.exception.AndEngineException;

/**
 * (c) Zynga 2011
 *
 * @author Nicolas Gramlich <[email protected]>
 * @since 21:13:32 - 11.10.2011
 */
 public enum BoundsSplit {
// ===========================================================
// Elements
// ===========================================================

TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT;

// ===========================================================
// Constants
// ===========================================================

// ===========================================================
// Fields
// ===========================================================

// ===========================================================
// Constructors
// ===========================================================

// ===========================================================
// Getter & Setter
// ===========================================================

// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================

// ===========================================================
// Methods
// ===========================================================

// ===========================================================
// Inner and Anonymous Classes
// ===========================================================

public static class BoundsSplitException extends AndEngineException {
    // ===========================================================
    // Constants
    // ===========================================================

    private static final long serialVersionUID = 7970869239897412727L;

    // ===========================================================
    // Fields
    // ===========================================================

    // ===========================================================
    // Constructors
    // ===========================================================

    // ===========================================================
    // Getter & Setter
    // ===========================================================

    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================

    // ===========================================================
    // Inner and Anonymous Classes
    // ===========================================================
}

}

EDIT:

Here is more on what the error says

Multiple markers at this line
- The type java.lang.Enum cannot be resolved. It is indirectly referenced from
 required .class files
- The type Enum is not generic; it cannot be parameterized with arguments
 <BoundsSplit>
- The type java.lang.Object cannot be resolved. It is indirectly referenced from
 required .class files
- The type java.lang.Enum cannot be resolved. It is indirectly referenced from
 required .class files
解决方案

Well, it seems that this error has many causes. The main one from searching the web (Here) is that the .classpath file in the project directory is wrong - that's the one I had, too. It's probably AndEngine's project who has the wrong file, because you said this problem was encountered when you updated it.

So, you can either:

  1. Solve it. This page has a nice explanation of the problem, check it out. You can get more information here.
  2. Instead of importing AndEngine source into your workspace in eclipse (Which I guess you did, because that's probably the source of the problem), you can just link the source folder, then eclipse won't bug checking the AndEngine project files (Which might be wrong).

Another reason might be because of mis-configured JRE system library. There is a nice tutorial of how to fix that here.

By the way, this problem is related to eclipse, so I'll retag your question with eclipse tag, so if my answer won't help - at least you will get better ones :)

这篇关于ENUM类型不是一般性错误克隆andengine的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 07:54