2014-12-09 15 views
9

Pracuję z Android Annotations i dzisiaj zrobiłem nową aktualizację dla Android Studio 1.0.Android Adnotacja Błąd z Android Studio Aktualizacja 1.0

Kiedy zbudować projekt dał mi ten błąd:

Error:(40, 0) Could not find property 'processResources' on com.and[email protected]54335f5. 

Oto moja build.gradle plik dla my project:

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.0.0' 


     // the latest version of the android-apt plugin https://bitbucket.org/hvisser/android-apt 
     // http://stackoverflow.com/a/25939518 
     classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 


allprojects { 
    repositories { 
     jcenter() 
    } 
} 

i jest to plik build.gradle dla my application:

apply plugin: 'com.android.application' 
apply plugin: 'com.neenbedankt.android-apt' 
// duhet per te shtuar librarine e android annotations ne ccompile time http://joostfunkekupper.com/useful-android-libraries/ 
// https://github.com/excilys/androidannotations/wiki/IntelliJIDEA 
android { 
    compileSdkVersion 21 
    buildToolsVersion '21.1.1' 
    defaultConfig { 
     applicationId "<my package>" 
     minSdkVersion 14 
     targetSdkVersion 21 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    productFlavors { 
    } 
} 
// https://github.com/excilys/androidannotations/wiki/FAQ 
// https://github.com/DayS/androidannotations/wiki/Building-Project-Gradle 
//https://bitbucket.org/hvisser/android-apt 
apt {// http://stackoverflow.com/a/26284580 
    arguments { 
     androidManifestFile variant.processResources.manifestFile 
     // This should of course be your own package name 
     resourcePackageName '<my package>' 

    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.actionbarsherlock:actionbarsherlock:[email protected]' 
    compile project(':FreeFlow') 
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3' 
    compile 'com.squareup.retrofit:retrofit:1.7.0' 
    compile project(':library') 
    compile project(':facebook') 
    compile project(':viewPagerIndicatorLibrary') 
    compile 'com.google.code.gson:gson:2.3' 
    compile 'com.android.support:support-v4:21.0.0' 
    compile 'com.neenbedankt.gradle.plugins:android-apt:1.4' 
    apt 'org.androidannotations:androidannotations:3.2' 
    compile 'org.androidannotations:androidannotations-api:3.2' 
    compile 'com.squareup:otto:1.3.5' 
    compile 'com.paymill.android:android-sdk:1.2.0' 
} 

Line 40 gdzie błąd się dzieje w drugim build.gradle:

androidManifestFile variant.processResources.manifestFile 

Czy ktoś napotkał ten problem, bo nie mogłem znaleźć żadnego rozwiązania tego problemu

Dzięki

Odpowiedz

16

W nowej wersji Androida Studio obowiązują pewne zmiany.
Aby uzyskać przykład pliku build.gradle, zobacz artykuł this wiki page.
zwrócić uwagę na tę linię:

androidManifestFile variant.outputs[0].processResources.manifestFile 
+0

Hi yDelouis, nie używam Androida adnotacje ale jestem stoi podobny problem z niestandardowym pliku build.gradle, byś wiedział, w którym można znaleźć informacje na temat wszystkich zmiany na Androidzie Gradle plugin 1.0? – PoPy

+0

Ten sam problem co PoPy. Wszystkie odpowiedzi na to pytanie wydają się być związane z apt i adnotacjami. – jbekas