如何在 Android Studio 中更改 Linphone 的项目名称?

How to change Project Name of Linphone in Android Studio?

我已经在 Mac 上成功地为 android 构建了 Linphone 项目,并且它在 Android Studio 中运行良好。现在我想重命名包

org.linphone

com.my.package.name

在 README 中给出了

To create an apk with a different package name
----------------------------------------------
You need to edit the custom_rules.xml file:
1) look for the property named "linphone.package.name" and change it value accordingly
2) also update the values in the AndroidManifest file where the comment <!-- Change package ! --> appears
3) update the path to the sounds in the linphonerc-factory files in the res folders and optionally change default sip account on linphonerc-default
4) run again the Makefile script by calling "make"

我按照前2步,但不明白第3步。如果我尝试从 Android Studio 更改包名称,那么它会给我很多错误,例如找不到 R 文件等。有人能告诉我在 [=27= 中重命名 Linphone 包名称的正确方法吗? ]工作室。

OR

使用 Linephone SDK 是个好主意吗?我还创建了 linphone.jar(使用 armeabi-v7a 和 x86)并放置在其他项目的 lib 文件夹中,但不知道如何使用这些 lib。在现有项目中。

如果只是更改包名称的简单问题,请单击包资源管理器右上角的齿轮符号并取消选中紧凑的空中间包。 然后您可以右键单击每个单独的包名称,重构并重命名。重命名com前缀时 select 如果出现错误则全部重命名。完成后再次检查紧凑的空中间包并更新 build.gradle 中的 applicationID。如需更全面的指南,请遵循 this 答案。

"If it is a simple issue of changing the package name then click the cog symbol in the top right of the package explorer and uncheck compact Empty Middle Packages. You can then right click each separate package name, re-factor and rename. When renaming the com prefix select Rename All if an error arises. When your finished check compact empty middle packages again and update the applicationID in build.gradle. For a more comprehensive guide follow this answer."

不,这不是一个简单的问题!在我的工作中,我们决定在 Linphone 之上构建一个应用程序。 1. 更改包名称时出现问题。好的,我做到了,现在我可以将应用程序上传到 Google 商店!问题解决了?不!!! 如果您尝试 运行 您的应用程序与原始的 linphone 应用程序一起使用,它会崩溃!所以 ===> 它会与任何其他基于 linphone 的应用程序一起粉碎(如果程序员做得不好)。

解决方案? 蛮力! 将名为 linphone 的项目文件中的任何子字符串更改为 xxx(xxx=您的应用程序名称) 将所有包含名称 linphone 的文件名更改为 xxx(xxx=您的应用程序名称) 将所有包含名称 linphone 的目录名称更改为 xxx(xxx=您的应用程序名称) 对字符串 Linphone 做同样的事情。 (大写后者。)

我花了 3 天时间!要解决这个问题,唯一的解决办法是蛮力,这是我发现解决共谋错误的唯一有效方法。 在我的工作中,我使用了一个简单的 python 脚本来完成这项工作。这真的很简单,困难的部分是考虑这个蛮力解决方案。 祝你好运。