2015-02-16 2 views
3

Я использую Android Studio 1.1 Beta 4 с Gradle плагин 1.0.1 и пытается добавить Android Аннотации к моему проекту после official insturctions. Таким образом, я получаю следующее build.gradle файл:Android аннотаций Gradle предупреждение

apply plugin: 'com.android.application' 
apply plugin: 'android-apt' 

android { 
    compileSdkVersion 21 
    buildToolsVersion "21.1.2" 

    defaultConfig { 
     applicationId "ru.itloft.moneytracker" 
     minSdkVersion 14 
     targetSdkVersion 21 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_7 
     targetCompatibility JavaVersion.VERSION_1_7 
    } 
    packagingOptions { 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/license.txt' 
    } 
} 
def AAVersion = '3.2' 
dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:21.0.3' 
    apt "org.androidannotations:androidannotations:$AAVersion" 
    compile "org.androidannotations:androidannotations-api:$AAVersion" 
    compile 'org.springframework.android:spring-android-rest-template:2.0.0.M1' 
    compile 'com.google.code.gson:gson:2.3' 
    compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT' 
} 
apt { 
    arguments { 
     androidManifestFile variant.outputs[0].processResources.manifestFile 
     // if you have multiple outputs (when using splits), you may want to have other index than 0 

     resourcePackageName 'ru.itloft.moneytracker' 

     // If you're using Android NBS flavors you should use the following line instead of hard-coded packageName 
     // resourcePackageName android.defaultConfig.packageName 

     // You can set optional annotation processing options here, like these commented options: 
     // logLevel 'INFO' 
     // logFile '/var/log/aa.log' 
    } 
} 

И все работает отлично, но я получаю предупреждение в строке androidManifestFile variant.outputs[0].processResources.manifestFile говоря: «getAt» в «org.codehaus.groovy.runtime.DefaultGroovyMethods 'не может применяться к' (java.lang.Integer) '. Как я могу избавиться от этого предупреждения?

+2

Вы сказали «gradle 1.0.1». Тем не менее, я предполагаю, что это не ваша версия с градиентом, но версия плагина для Android-версии, я прав? – WonderCsabo

+0

Я прошел немного сложнее, установив AA на последнюю студию Android, и оставил пустой проект, имея его для кого-либо еще. https://github.com/juanmendez/android-annotation-studio-demo –

+0

Спасибо тонну. Это помогло мне. – harik

ответ

6

Как @WonderCsabo уже сказал, что это ложный позитив. Вы можете избежать этого предупреждения, если вы обращаетесь к выводам, явным как сбор

androidManifestFile variant.outputs.collect()[0].processResources.manifestFile 
Смежные вопросы