【问题标题】:Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(org.jsonschema2pojo.gradle.)错误:警告:忽略匿名内部类的 InnerClasses 属性错误:(org.jsonschema2pojo.gradle。)
【发布时间】:2016-07-29 15:48:18
【问题描述】:

这个问题是在我将我的 android studio 更新到 2.0 之后发生的,当我尝试运行时我得到了这个:

错误:警告:忽略匿名内部类的 InnerClasses 属性 错误:(org.jsonschema2pojo.gradle.GenerateJsonSchemaTask$_configureAndroid_closure4) 不附带 错误:关联的 EnclosureMethod 属性。这个类可能是由一个 错误:没有针对现代 .class 文件格式的编译器。推荐的 错误:解决方案是使用最新的编译器从源代码重新编译类 错误:并且没有指定任何“-target”类型选项。忽视的后果 错误:此警告是对此类的反射操作将错误 错误:表明它不是一个内部类。

这是我的 build.gradle(模型:app)

谁能告诉我如何解决这个问题。

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
//apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    defaultConfig {
        applicationId "tazligen.com.tazligen"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'NOTICE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txtd'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/NOTICE.txt'
    }
    productFlavors {
    }
}

ext {
    supportLibVersion = "23.2.1"
    googlePlayServicesVersion = "8.4.0"
    junitVersion = "4.12"
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile "junit:junit:${junitVersion}"

    // Android Support Library
    compile "com.android.support:appcompat-v7:${supportLibVersion}"
    compile "com.android.support:cardview-v7:${supportLibVersion}"
    compile "com.android.support:support-v4:${supportLibVersion}"
    compile "com.android.support:recyclerview-v7:${supportLibVersion}"
    compile "com.android.support:design:${supportLibVersion}"

    // Networking libraries
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'org.jsonschema2pojo:jsonschema2pojo-gradle-plugin:0.4.16'
    compile 'javax.annotation:jsr250-api:1.0'
    compile 'org.apache.httpcomponents:httpmime:4.3.1'
    compile 'org.apache.httpcomponents:httpcore:4.4.4'
    compile 'com.squareup.picasso:picasso:2.5.2'

    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'io.realm:realm-android:0.84.1'
    compile 'info.hoang8f:android-segmented:1.0.6'

    compile 'com.github.blackfizz:eazegraph:1.2.2@aar'
    compile 'com.nineoldandroids:library:2.4.0'

    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }
}

【问题讨论】:

  • 我遇到了同样的问题。请按照以下步骤操作:1-关闭 Android Studio 并重新打开它 2-重新构建您的项目这对我有用。我希望这对你也有用
  • 我很确定我试过了,然后我尝试了我刚刚给出的解决方案,奇怪的是它起作用了,无论如何谢谢:)

标签: java android


【解决方案1】:

好吧,我自己解决了这个问题。好吧,我刚刚删除了该行

compile 'org.jsonschema2pojo:jsonschema2pojo-gradle-plugin:0.4.16'

它奏效了。在 android studio 2.0 中猜测这不再是必需的。无论如何它对我有用。

【讨论】:

  • 我想知道是不是某些依赖库的问题。
猜你喜欢
  • 2017-02-12
  • 2018-06-25
  • 2018-03-18
  • 2015-01-15
  • 2017-02-13
  • 2013-06-13
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多