applicationId is set to 'com.super.app' in default config

来源:互联网 发布:linux 查询进程端口号 编辑:程序博客网 时间:2024/06/16 02:40

转载请标明出处:http://blog.csdn.net/xx326664162/article/details/50160097 文章出自:薛瑄的博客

你也可以查看我的其他同类文章,也会让你有一定的收货!

错误信息:

Error: Library projects cannot set applicationId. applicationId is set to ‘com.super.app’ in default config.

代码示例:

defaultConfig {        applicationId "com.super.app"   <---- remove this line        minSdkVersion 15        targetSdkVersion 19        versionCode 1        versionName "1.0"    }

不能使用applicationId 去定制包名在lib module中,在lib module中必须是固定的,可以在manifest中指定包名,

有两种解决办法:

一、 去除applicationId “com.super.app” 代码,在defaultConfig 节点中。

defaultConfig {        minSdkVersion 15        targetSdkVersion 19        versionCode 1        versionName "1.0"    }

并在AndroidManifest.xml中声明包名:

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"        xmlns:tools="http://schemas.android.com/tools"        package="com.super.app">

二、 This is the right solution if you don’t need to rename the package name of your app. To rename it you need to use “flavours”:

android {   ...   productFlavors {       flavor1 {           applicationId 'com.super.superapp'       }   }

转载:http://stackoverflow.com/questions/27374933/android-studio-1-0-and-error-library-projects-cannot-set-applicationid

1 0