android gradle build 关闭Manifest merge

1. 在Android studio中 Manifest merge 默认是打开的, 但最近将项目从ADT换到AS上时, 会manifest会自动merge, 解决办法

  a. 用官方的方法合并, 参考 http://www.cnblogs.com/iori-zy/p/4433900.html

  b. 关闭Manifest merge 
    在module的build.gradle最后加上

android.applicationVariants.all{ variant ->
    variant.outputs.each { output ->
        output.processResources.manifestFile = file('src/main/AndroidManifest.xml')
        output.processManifest.enabled=false
    }
}

 

参考: http://stackoverflow.com/questions/27790209/how-to-use-the-new-manifest-merger-of-android-studio-and-gradle
  http://stackoverflow.com/questions/13937123/disable-manifest-merger-in-android-gradle-build?answertab=votes#tab-top

posted on 2015-05-13 16:59  Iori_z  阅读(1269)  评论(0)    收藏  举报

导航