I'm making an app using Android Studio v0.5.9, which has a library project as a dependency. But, every time I run the project two apks having the same name and icon, are deployed to my device. The first apk(app) contains my main module, whereas, the second one is the library project itself. However, when I run the same project from Eclipse, only one apk is deployed and it works perfectly.
Here are some screenshots of the problem -
First App(My module) -
Second App(library project) -
top-level build.gradle
file -
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
}
}
main module build.gradle
file -
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.0.3'
defaultConfig {
packageName 'com.Swap.Rooms'
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName '1.0'
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:19.0.1'
compile 'com.android.support:appcompat-v7:19.0.1'
compile 'com.android.support:appcompat-v7:19.+'
compile project(':lib')
}
library project build.gradle
file -
apply plugin: 'android-library'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
packageName "com.jfeinstein.jazzyviewpager"
minSdkVersion 4
targetSdkVersion 17
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:+'
compile files('libs/nineoldandroids-2.4.0.jar')
}
settings.gradle
-
include ':app'
include ':lib'
Please help me to fix this. Thanks in advance!!