2

After using in two of my app classes the following line: @org.parceler.Parcel, I'm getting this Gradle Build Error:

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.

In spite of it, the app compiles and runs succesfully. However this error annoys me because I don't know if it will cause app crashes.

My 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'
piotrek1543
  • 19,130
  • 7
  • 81
  • 94
Daniel
  • 708
  • 1
  • 8
  • 18

2 Answers2

0

Remove this line

compile 'org.parceler:parceler-api:1.0.3'
Yogesh Rathi
  • 6,331
  • 4
  • 51
  • 81
0

according to this issue: https://github.com/johncarl81/parceler/issues/19

the answer is:

you're running into the dex method limit. Unrelated to this library.

It seems to you should enable multidex in your app to hide this warning.

This might be helpful: How to enable multidexing with the new Android Multidex support library

Community
  • 1
  • 1
piotrek1543
  • 19,130
  • 7
  • 81
  • 94
  • I've enabled multidex by adding "multiDexEnabled true" to build.gradle, however the Gradle Error still appears. Do you think such build error would cause my app to crash for the final users? My tests are OK so far. – Daniel Aug 28 '16 at 06:03
  • are you sure that you'd enabled Multidexing properly. Did you may have forgotten about `MultiDex.install(getTargetContext());` in class where you initialize Parceler. If I were you, I would open new issue on Parceler site and check answers. No, I don't think that it would crahs on users phones. – piotrek1543 Aug 28 '16 at 06:08
  • Similar issue: http://stackoverflow.com/questions/36592864/error-in-gradle-build-after-updating-android-studio-with-log4j - the answer is that this kind of problem is safe and good to ignore. You can try update your support libraries to hide this issue – piotrek1543 Aug 28 '16 at 06:12