android - 使用@ org.parceler.Parcel后,Android Studio Gradle错误

标签 android android-studio gradle android-gradle-plugin build.gradle

在我的两个应用程序类中使用以下行:@ org.parceler.Parcel之后,出现此Gradle Build错误:

warning: Ignoring InnerClasses attribute for an anonymous inner class (org.parceler.apache.commons.collections.BeanMap$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.graddle(app):
apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.my.app"
        minSdkVersion 9
        targetSdkVersion 24
        versionCode 26
        versionName "2.0.18"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    signingConfigs {
        release {
            storeFile file("omitted")
            storePassword "omitted"
            keyAlias "omitted"
            keyPassword "omitted"

        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:24.2.0'
    compile 'com.android.support:design:24.2.0'
    compile 'com.android.support:support-v4:24.2.0'
    compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
    compile 'com.android.support:preference-v7:24.2.0'
    // [START gms_compile]
    compile 'com.google.android.gms:play-services-analytics:9.4.0'
    // [END gms_compile]
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'org.parceler:parceler:1.0.3'
    compile 'org.parceler:parceler-api:1.0.3'
    compile 'com.google.code.gson:gson:2.4'
    compile 'com.android.support:cardview-v7:24.2.0'
    compile 'com.android.support:recyclerview-v7:24.2.0'

}

apply plugin: 'com.google.gms.google-services'

最佳答案

删除此行

compile 'org.parceler:parceler-api:1.0.3'

关于android - 使用@ org.parceler.Parcel后,Android Studio Gradle错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39187934/

相关文章:

安卓 Espresso Intent

android - 如何在 Android Studio 1.0 中查找过滤器 Logcat 配置?

Android:无法让 YouTube Player API 在 fragment 内工作

Android Studio 无法访问其他类中的函数

gradle - 从特定 URL 获取依赖项

android - Azure 通知中心仍依赖 GCM,并有 6 个月的时间关闭

java - 在 Android Studio Java 编辑器中禁用灯泡

android - 渲染问题 渲染期间引发异常 : Could not find layout resource

intellij-idea - 没有JRebel IDE插件的Gradle + JRebel + rebel-remote.xml

android - 如何使用 Gradle 更改 App Bundle 生成的文件名?