Reputation: 63
i am using a library and when i sync my project iam getting this error Could not get unknown property 'compileSdkVersion' for root project 'Cropimg' of type org.gradle.api.Project. my gradle is
apply plugin: 'com.android.library'
gradle-builds
apply plugin: 'maven-publish'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName PUBLISH_VERSION
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions {
abortOnError false
}
}
android.libraryVariants
publishing {
publications {
maven(MavenPublication) {
groupId PUBLISH_GROUP_ID
artifactId PUBLISH_ARTIFACT_ID
version PUBLISH_VERSION + '-SNAPSHOT'
//artifact bundleRelease
}
}
}
dependencies {
compile "com.android.support:appcompat-v7:$supportLibraryVersion"
compile("com.android.support:exifinterface:$supportLibraryVersion") {
transitive = false
}
}
Upvotes: 3
Views: 11609
Reputation: 985
In your project build.gradle declare compileSdkVersion
`
ext {
compileSdkVersion = 26
buildToolsVersion = '26.0.2'
}
`
Upvotes: 6