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

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

问题描述

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

目前,我的应用程序的包名称是com.example.test".我想将其更改为com.example.test.test1".所以,我刚刚更改了清单文件中的包名称并构建了应用程序.

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

由于包名不同,它应该向我显示设备中的不同应用程序,而不是用其他应用程序覆盖一个应用程序.帮帮我.

任何帮助将不胜感激.谢谢

解决方案

packageName 属性从 Android Studio V0.0.6 开始被弃用.要更改应用程序的包名称,请改用 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天全站免登陆