问题描述
我有麻烦理解建立在Android的工作室香精。我想实现一个简单的事情:buidling 2 APK签署的与未成年code修改。 亲APK只是在不同的
。我的文档中读到了一些东西,在这里对计算器,但我没有看到任何发生在我的 drawer.xml
RES /布局/ build.gradle
的变化。
I am having troubles understanding Build Flavors in Android Studio. I am trying to achieve a simple thing: buidling 2 signed APK's with a minor code change. The "pro" APK just has a different drawer.xml
in res/layout/
. I've read a few things in the Documentation and here on StackOverflow but I don't see anything happen with my build.gradle
changes.
我目前的 build.gradle
文件:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4.+'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
compile files('libs/GoogleAdMobAdsSdk-6.4.1.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 14
targetSdkVersion 17
}
productFlavors {
lite {
packageName = 'com.mikebdev.refuel'
}
pro {
packageName = 'com.mikebdev.refuelpro'
}
}
sourceSets{
android.sourceSets.pro {
res.srcDirs = ['src/main/res_pro']
}
}
}
我创建了一个新的文件夹:
I created a new folder:
/src/main/res_pro/layout/drawer.xml
我在做什么错在这里?
What am I doing wrong here?
修改
我更新了我的build.gradle文件之上。
I updated my build.gradle file above.
重置,因为一些其他的不稳定性的我整个Android的工作室后,我现在可以在左下角我的生成变种(精简版调试,精简版释放,有利于调试,有利于释放)选择为什么即使是调试和发布变种?
After resetting my whole Android Studio because of some other instabilities I am now able to choose in the bottom left corner my build variants (lite-debug, lite-release, pro-debug, pro-release) Why even those debug AND release variants?
这似乎是现在的工作,因为它应该。
This seems to work now as it should.
我添加以下
推荐答案
重置,因为一些其他的不稳定性,我现在可以在左下角选择我的生成变种(精简版调试,精简版发布的我的整个Android的工作室后, ,亲调试,有利于释放)为什么即使是调试版本和发布版本?
After resetting my whole Android Studio because of some other instabilities I am now able to choose in the bottom left corner my build variants (lite-debug, lite-release, pro-debug, pro-release) Why even those debug AND release variants?
我创建了一个全新的项目与模块和复制和;粘贴一切从我的老项目,我从那里蚀而回出口
I created a whole new Project with Module and copy&pasted everything from my old project which I exported from eclipse a while back in there.
现在它的工作原理。
我的Android工作室我重新安装之前有点破。更崩溃不是应该有一些奇怪的行为,ANS这样的东西。
My Android-Studio was kinda broken before my reinstall. More crashes than there should be, some strange behaviors ans such stuff.
这篇关于Android的工作室摇篮建立香精的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!