2

我写的 build.gradle 如下:

sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
         hip {
            manifest.srcFile 'hip/AndroidManifest.xml'
}
        instrumentTest.setRoot('tests')

        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

但我只能找到主要的一个 apk,而不是 hip 一个。

4

1 回答 1

0

您必须定义产品风味:

android {
  ...
  productFlavors {
    hip {
        manifest.srcFile 'hip/AndroidManifest.xml'
    }

    main {
        manifest.srcFile '<where you put the other one>/AndroidManifest.xml'
    }
}
于 2013-09-16T13:51:33.640 回答