首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用@org.parceler.Parcel后的Android分级错误

使用@org.parceler.Parcel后的Android分级错误
EN

Stack Overflow用户
提问于 2016-08-28 04:12:29
回答 2查看 534关注 0票数 2

在我的两个应用程序类中使用了以下一行之后:@org.parceler.Parcel,我得到了这个Gradle构建错误:

警告:对于不附带关联的(org.parceler.apache.commons.collections.BeanMap$1)属性的匿名内部类EnclosingMethod,忽略EnclosingMethod属性。这个类可能是由不针对现代.class文件格式的编译器生成的。建议的解决方案是使用最新的编译器,不指定任何"-target“类型选项,从源重新编译类。忽略此警告的后果是,对该类的反射操作将错误地指示它不是内部类。

尽管如此,该应用程序还是成功地编译和运行。然而,这个错误让我很恼火,因为我不知道它是否会导致应用程序崩溃。

我的build.graddle (应用):

代码语言:javascript
复制
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'
EN

回答 2

Stack Overflow用户

发布于 2016-08-28 04:14:31

移除这一行

代码语言:javascript
复制
compile 'org.parceler:parceler-api:1.0.3'
票数 0
EN

Stack Overflow用户

发布于 2016-08-28 05:43:33

根据这个问题:https://github.com/johncarl81/parceler/issues/19

答案是:

你遇到了dex方法的限制。和这个图书馆无关。

在你看来,你应该让应用程序中的multidex隐藏这个警告。

这可能会有帮助:How to enable multidexing with the new Android Multidex support library

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39187934

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档