Android studio has built two applications for the same project at the same time

I am using Android studio v0.5.9 to create an application with a library project as a dependency. However, every time I run the project, two apks with the same name and icon will be deployed to my device. The first APK (APP) contains my main module, and the second is the library project itself. However, when I run the same project from eclipse, only one APK is deployed, It works normally

Here are some screenshots of the problem –

First application (my module) –

Second application (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 solve this problem. Thank you in advance!!

resolvent:

Maybe it will help others

Gradle is also merging the list of library items. So the problem is to keep androidmanifest.xml and the library unchanged. It has an application node for demonstration purposes, and the node has been successfully merged into the main androidmanifest.xml

I intend to submit a question to Google because I think it should prevent or warn this situation

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>