通过Android Studio更改应用程序包名称 [英] Change Application Package name through Android Studio

查看:549
本文介绍了通过Android Studio更改应用程序包名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在SO中多次问过这个问题.我检查了以下发布的答案,但对我不起作用:(

当前,我的应用程序的程序包名称为" com.example.test ".我想将其更改为" com.example.test.test1 ".因此,我只是在清单文件中更改了程序包名称并构建了应用程序.

现在,如果我分别运行两个应用程序,并且上述软件包名称从清单文件更改为设备,那么它将向我显示不同的应用程序.它显示错误为"失败[INSTALL_FAILED_CONFLICTING_PROVIDER] "

由于软件包名称不同,因此应该向我显示设备中的不同应用程序,而不是将一个应用程序替换为另一个应用程序.

任何帮助将不胜感激.

解决方案

从Android Studio V0.0.6开始不推荐使用packageName属性.要更改应用程序的程序包名称,请改用applicationId.在此处查看发行说明.

更改applicationId并同步gradle.

I am aware that this question is asked several times in SO. I have checked below answers posted but doesn't work for me :(

Currently, my application's package name is "com.example.test".I want to change this to "com.example.test.test1".So, I just changed the package name in my manifest file and build the app.

Now ,if I run both the applications seperately with above package names changed from manifest files into device than it should show me different applications.It shows me error as "Failure [INSTALL_FAILED_CONFLICTING_PROVIDER]"

As the package names are different, it should show me different applications in the device instead of overriding one app with other.Help me out.

Any help would be appreciated.Thanks

解决方案

The packageName attribute is deprecated as of Android Studio V0.0.6 onward. To change the package name of the application, use applicationId instead. Check the release notes here.

Change the applicationId and sync gradle.

这篇关于通过Android Studio更改应用程序包名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆