如何在 Unity3d 中更改包名称

How to change package name in Unity3d

最近我创建了我的第一个应用程序并创建了一个 apk 文件以上传到 goolge play。上传后 google 说上传失败因为:

Upload failed
 You uploaded an APK that was signed in debug mode. You need to sign your APK    in release mode. Learn more about signing.
You need to use a different package name because "com.jirbo.unitytest" already exists in Google Play.

所以我的问题是如何将 com.jirbo.unitytest 更改为我公司的包裹名称?

转到文件->构建设置->播放器设置->其他设置。在标识设置中,将 Bundle Identifier 更改为 "com.yourcompanyname.projectname".

解决方案

问题是我导入 Unity3D AdColony Plugin 并且这个插件有它自己的 Android XML 清单。所以即使我统一更改 Bundle Identifier,它也会使用 Adcolony。所以我的包名称由 com.jirbo.unitytest 包标识符创建,并且在 Google 播放中这个包已经存在。为了解决这个问题,我在 Unity Player 设置和 Adcolony XML 清单中复制并粘贴了我自己的 Bundlie 标识符。

  1. 按 Control + Shift + B 或(Command Shift + B,MacOSX)显示构建设置对话框

  1. SelectAndroid左边;
  2. 单击 "Player Settings" 按钮
  3. 在检查器中,向下滚动到其他设置,在那里更改捆绑包标识符。