각 국가 별 드로어 블이 countrycode / res /에있는 국가 별 APK를 생성하려고합니다.
(현재 "우리"와 "it"의 2 개 국가)와 공통 자원은 단순히 un res /
res/drawable/generic.png
res/drawable/specific.png
it/res/drawable/specific.png
us/res/drawable/specific.png
여기 내 빌드 파일이 있습니다.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion 15
buildToolsVersion "18.1.0"
flavorGroups "lang"
productFlavors {
it {
flavorGroup "lang"
}
us {
flavorGroup "lang"
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
it{
res.srcDirs = ['it/res']
}
us{
res.srcDirs = ['us/res']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
signingConfigs {
release {
storeFile file("signing/mykey.keystore")
storePassword "******"
keyAlias "myalias"
keyPassword "******"
}
}
buildTypes {
debug {
versionNameSuffix "-DEBUG"
packageNameSuffix ".debug"
}
release {
debuggable false
signingConfig signingConfigs.release
}
debugRelease.initWith(buildTypes.release)
debugRelease {
debuggable true
packageNameSuffix '.debugrelease'
signingConfig signingConfigs.release
}
}
}
하지만 오류와 함께 빌드에 실패합니다. java.lang.StackOverflowError이 빌드를 설정하는 데 도움을 줄 수 있습니까? 고마워
나는 마침내 그것을 만들었습니다.이 블로그 게시물은 저에게 많은 도움이됩니다 : http://apporia.blogspot.fr/2013/11/gradle-and-flavor-groups.html
stackOverflowError 오류는 플레이버 이름에서 비롯됩니다. "it"의 이름을 "italy"로, "us"를 "usa"로 이름을 바꾸고 빌드가 성공적으로 완료되었습니다.이를 파악하는 데 몇 시간이 걸립니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다