我一直试图让我的gradle文件中的注释工作,以便我可以用匕首,但迄今为止收效甚微。这是我的gradle文件(使用android studio 1.0和gradle 1.0.0-rc4),当我尝试同步时,我收到以下错误:
Error:No such property: projectDependencies for class: com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated
Gradle文件:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0-rc4'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
repositories {
mavenCentral()
}
android {
compileSdkVersion 21
buildToolsVersion '21.1.1'
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
}
lintOptions {
checkReleaseBuilds false
abortOnError false
disable 'InvalidPackage'
}
buildTypes {
release {
minifyEnabled true
proguardFile 'proguard-android.txt'
}
debug {
minifyEnabled true
proguardFile 'proguard-android.txt'
}
}
dexOptions {
preDexLibraries = false
}
}
apt {
arguments {
androidManifestFile variant.processResources.manifestFile
resourcePackageName 'my_package_name'
}
}
dependencies {
...
// Dependency Injection
compile 'com.squareup.dagger:dagger:1.2.2'
provided 'com.squareup.dagger:dagger-compiler:1.2.2'
...
apt 'org.androidannotations:androidannotations:3.0.1'
compile 'org.androidannotations:androidannotations-api:3.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
答案 0 :(得分:2)
我不确定这是否可以解答您的整个问题,但错误可以通过以下方式解决:
替换此行:androidManifestFile variant.processResources.manifestFile
至:androidManifestFile variant.outputs[0].processResources.manifestFile
根据此reference