android studio 怎么配置apt

2024-11-22 04:05:06
推荐回答(1个)
回答1:

android studio 中配置androidAnnotation 的新版正确配置
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '3.2'

android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc2"

defaultConfig {
applicationId "com.peiandsky.firstandroidstudio"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'

apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
}

apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName 'com.peiandsky.firstandroidstudio'
}
}