2015-06-29 22 views
8

Son zamanlarda Android annotations deniyordum ve her şey dosyama build.gradle dosyama eklemeye karar verene kadar iyi çalışıyordu. Projeden generated dizin kaldırılırken, ben temizlik ve tekrar yeniden denedimAndroid ek açıklamaları ve applicationIdSuffix

:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:pre_testBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
No matching client found for package name 'org.me.myapp.debug'
:app:generateDebugResources
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac
Note: Resolve log file to /dir/myapp/app/build/generated/source/apt/androidannotations.log
Note: Initialize AndroidAnnotations 3.3.1 with options {androidManifestFile=/dir/myapp/app/build/intermediates/manifests/full/debug/AndroidManifest.xml}
Note: Start processing for 4 annotations on 18 elements
Note: AndroidManifest.xml file found with specified path: /dir/myapp/app/build/intermediates/manifests/full/debug/AndroidManifest.xml Note: AndroidManifest.xml found: AndroidManifest [applicationPackage=org.me.myapp.debug, componentQualifiedNames=[org.me.myapp.ui.MainActivity_, net.hockeyapp.android.UpdateActivity], permissionQualifiedNames=[android.permission.ACCESS_WIFI_STATE, android.permission.ACCESS_NETWORK_STATE], applicationClassName=null, libraryProject=false, debugabble=false, minSdkVersion=15, maxSdkVersion=-1, targetSdkVersion=22]
error: The generated org.me.myapp.debug.R class cannot be found
Note: Found Android class: android.R
Note: Time measurements: [Whole Processing = 15 ms], [Extract Manifest = 4 ms], [Extract Annotations = 3 ms],
Note: Finish processing
Note: Start processing for 0 annotations on 0 elements
Note: Time measurements: [Whole Processing = 0 ms],
Note: Finish processing
1 error
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.

, ama hiçbir şey:

buildTypes { 
    debug { 
     applicationIdSuffix '.debug' 
    } 

    ... 
} 

Ve gradle konsolunda aşağıdaki günlüğünü almak derleme üzerine: Şu an için bu gibi görünüyor yardım eder. applicationIdsuffix'u build.gradle dosyasından kaldırırsam her şey yolunda gider. Bu sorunu nasıl giderebilirim?

cevap

9

sizin build.gradle dosyadan bu satırı kaldırın:

resourcePackageName android.variant.applicationId 

Düzenleme:

resourcePackageName "org.me.myapp" 
+0

ı don: Bu yazının yazıldığı anda en iyi çözüm ya dosyanın release ila debug versiyonlarını geçmek için kendi gradle görevleri yazmak için, veya dosyadaki hem paket isimleri belirtmek gibi görünüyor bu çizginin hiçbir yerinde yok. – Mikhail

+0

Cevabımı düzenledim. – WonderCsabo

+1

veya "resourcePackageName android.defaultConfig.applicationId", kodlanmış değerlerin kullanılmasını önlemek için –