2

После использования в двух моих приложений классов следующую строку: @ org.parceler.Parcel, я получаю эту Gradle Строят Ошибка:Android Студия Gradle Ошибка после использования @ org.parceler.Parcel

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 (приложение):

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' 

ответ

0

Удалить эту строку

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

Спасибо, я удалил, но я получаю точно такое же сообщение об ошибке. – Daniel

+0

Хорошо, вы можете вернуться к старому уровню api 23, abd после проверки ошибки id еще не достигнув или нет –

+0

Я только начал возвращаться, но это стало очень грязным, так как у меня есть много вызовов нового API внутри моего исходного кода. – Daniel

0

по этому вопросу: https://github.com/johncarl81/parceler/issues/19

ответ:

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

Кажется, что ou должно включить в вашем приложении, чтобы скрыть это предупреждение.

Это может быть полезно: How to enable multidexing with the new Android Multidex support library

+0

Я включил multidex, добавив «multiDexEnabled true» для build.gradle, однако ошибка Gradle все еще появляется. Считаете ли вы, что такая ошибка сборки приведет к сбою моего приложения для конечных пользователей? До сих пор мои тесты в порядке. – Daniel

+0

уверены, что вы правильно включили Multidexing. Возможно, вы забыли о 'MultiDex.install (getTargetContext());' в классе, где вы инициализируете Parceler. Если бы я был вами, я бы открыл новую проблему на сайте Parceler и проверил ответы. Нет, я не думаю, что это будет ужасно для телефонов пользователей. – piotrek1543

+0

Аналогичная проблема: http://stackoverflow.com/questions/36592864/error-in-gradle-build-after-updating-android-studio-with-log4j - ответ заключается в том, что такая проблема безопасна и хороша для игнорирования , Вы можете попробовать обновить свои библиотеки поддержки, чтобы скрыть эту проблему. – piotrek1543

Смежные вопросы