2015-09-28 4 views
6

は、データバインディングクラスはもはや認識されていません。私はちょうど「がち..」の行をコメントアウトすると その後、すべてが再びコンパイルします。Androidの注釈や新しいAndroidのデータバインディング

それは何とかアンドロイド-annotionsが実行されてからaptのデータバインディングを防ぐこと?だろうかまたは実行順序が間違っていますか?

よろしく、Gradleのビルドから トーマス

エラー: $ Gradleのクリーンビルド

:app:clean 
:app:preBuild UP-TO-DATE 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:app:prepareComAndroidDatabindingLibrary10Rc1Library 
:app:prepareComAndroidSupportAppcompatV72300Library 
:app:prepareComAndroidSupportCardviewV72300Library 
:app:prepareComAndroidSupportDesign2300Library 
:app:prepareComAndroidSupportMultidex101Library 
:app:prepareComAndroidSupportRecyclerviewV72300Library 
:app:prepareComAndroidSupportSupportV42300Library 
:app:prepareComJourneyappsZxingAndroidEmbedded302Library 
:app:prepareDebugDependencies 
:app:compileDebugAidl 
:app:compileDebugRenderscript 
:app:generateDebugAssets UP-TO-DATE 
:app:mergeDebugAssets 
:app:generateDebugResValues UP-TO-DATE 
:app:generateDebugResources 
:app:mergeDebugResources 
AAPT: /opt/projects/erp/android/inventory-app/app/src/main/res/drawable-mdpi/ic_drawer.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited 
AAPT: /opt/projects/erp/android/inventory-app/app/src/main/res/drawable-xhdpi/ic_drawer.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited 
AAPT: /opt/projects/erp/android/inventory-app/app/src/main/res/drawable-hdpi/ic_drawer.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited 
:app:processDebugManifest 
:app:dataBindingLayoutsProcessDebugResources 
:app:processDebugResources 
:app:dataBindingInfoClassProcessDebugResources 
:app:generateDebugBuildConfig 
:app:generateDebugSources 
:app:processDebugJavaRes UP-TO-DATE 
:app:compileDebugJavaWithJavac 
/opt/projects/erp/android/inventory-app/app/src/main/java/org/moserp/MainActivity.java:37: error: package org.moserp.inventory.databinding does not exist 
import org.moserp.inventory.databinding.IncludeFacilityViewBinding; 
            ^
/opt/projects/erp/android/inventory-app/app/src/main/java/org/moserp/MainActivity.java:48: error: cannot find symbol 
    private IncludeFacilityViewBinding includeFacilityViewBinding; 

... 

Note: Resolve log file to /opt/projects/erp/android/inventory-app/app/build/generated/source/apt/androidannotations.log 
Note: Initialize AndroidAnnotations 3.3.2 with options {androidManifestFile=/opt/projects/erp/android/inventory-app/app/build/intermediates/manifests/full/debug/AndroidManifest.xml, logLevel=TRACE} 
Note: Start processing for 1 annotations [org.androidannotations.annotations.EActivity] on 64 elements ... 
Note: AndroidManifest.xml file found with specified path: /opt/projects/erp/android/inventory-app/app/build/intermediates/manifests/full/debug/AndroidManifest.xml 
Note: AndroidManifest.xml found: AndroidManifest [applicationPackage=de.moserp.inventory, componentQualifiedNames=[org.moserp.MainActivity_, ...], applicationClassName=android.support.multidex.MultiDexApplication, libraryProject=false, debugabble=false, minSdkVersion=17, maxSdkVersion=-1, targetSdkVersion=23] 
error: The generated de.moserp.inventory.R class cannot be found 
Note: Found Android class: android.R 

import com.android.build.gradle.tasks.Dex 

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

def AAVersion = '3.3.2' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23" 

    defaultConfig { 
     applicationId "de.moserp.inventory" 
     minSdkVersion 17 
     targetSdkVersion 23 
     versionName "1.0" 
     versionCode 1 
     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    dexOptions { 
     preDexLibraries = false 
    } 
    project.tasks.withType(Dex) { 
     additionalParameters=['--core-library'] 
    } 
    packagingOptions { 
     exclude 'META-INF/ASL2.0' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/notice.txt' 
    } 
    lintOptions { 
     abortOnError false 
    } 
} 

apt { 
    arguments { 
     androidManifestFile variant.outputs[0]?.processResources?.manifestFile 
    } 
} 

dependencies { 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.android.support:appcompat-v7:23.0.0' 
    // UI libraries 
    compile 'com.android.support:recyclerview-v7:23.0.0' 
    compile 'com.android.support:cardview-v7:23.0.0' 
    compile 'com.android.support:design:23.0.0' 
    //compile 'com.android.support:palette-v7:23.0.0' 
    //compile 'com.android.support:gridlayout-v7:23.0.0' 

    // Spring and Rest 
    compile('org.springframework.hateoas:spring-hateoas:0.17.0.RELEASE') { 
     exclude group: '*' 
    } 
    compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE' 
    compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2' 

    // ZXing Scanner Lib 
    compile 'com.journeyapps:zxing-android-embedded:[email protected]' 
    compile 'com.google.zxing:core:3.2.0' 

    // Frameworks - general 
    apt 'com.android.databinding:compiler:1.0-rc1' 
    apt "org.androidannotations:androidannotations:$AAVersion" 
    compile "org.androidannotations:androidannotations-api:$AAVersion" 
} 

repositories { 
    maven { 
     url 'http://repo.spring.io/milestone' 
    } 

} 
+0

(還元された)プロジェクトを共有できますか? – WonderCsabo

+0

はい、ここにあります:https://github.com/thomasletsch/sample-app –

答えて

3

build.gradleプロジェクトには二つの問題があります。

は、

まず: applicationIdde.moserp.inventoryですが、マニフェストpackage nameorg.moserp.inventoryです。あなたが同じに変更しなければならない、またはそれが意図的であれば、あなたが直接AAマニフェストpackage name伝える必要があります:

apt { 
    arguments { 
     androidManifestFile variant.outputs[0]?.processResources?.manifestFile 
     logLevel 'TRACE' 
     resourcePackageName 'org.moserp.inventory' 
    } 
} 

セカンドを:あなたが代わりに生成された一つで、マニフェストに元の活性を宣言。それをMainActivity_に変更してください。

+0

あなたは絶対に正しいです、アプリケーション名を変更して問題を解決しました!非常に高く評価! –

関連する問題