4

添加对 roboguice 2.0 的依赖项后,我在运行时收到很多警告,如下所示gradle build

warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.sf.cglib.util.StringSwitcher$Generator$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.

我的build.gradle文件看起来像:

buildscript { repositories { mavenCentral() } 依赖项 { classpath 'com.android.tools.build:gradle:0.4.2' } }

    apply plugin: 'android-library'

    repositories {
        mavenCentral()
    }

    dependencies {
        compile files('/libs/android-support-v4.jar')

        compile 'org.roboguice:roboguice:2.0'
    }

    android {
        compileSdkVersion 17
        buildToolsVersion "17.0.0"

        defaultConfig {
            minSdkVersion 10
            targetSdkVersion 16
        }
    }

我知道它们只是警告,但我是初学者,正在尝试这个新的构建系统,我想确保我走在正确的轨道上。

问候,

4

1 回答 1

2

值得注意的是,您可以通过从源代码重新编译 jar 来消除警告。更多信息@编译过程中输出的“Ignoring InnerClasses attribute”减弱是什么?

于 2013-10-25T16:57:11.087 回答