简体   繁体   English

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

[英]How to change Project Name of Linphone in Android Studio?

I have successfully build the Linphone project for android on Mac and its working fine in Android Studio. 我已经成功在Mac上为Android构建了Linphone项目,并且在Android Studio中可以正常工作。 Now I want to rename the package from 现在我想重命名软件包

org.linphone

to

com.my.package.name

in the README it is given 在自述文件中给出

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"

I follow the first 2 step, but do not understand the 3rd step. 我遵循第2步,但不了解第3步。 If I try to change the package name from Android Studio then it give me a lot of errors like do not find R file etc. Can anybody tell me the correct way to rename the package name of Linphone in Android Studio. 如果我尝试从Android Studio更改软件包名称,则会给我很多错误,例如找不到R文件等。有人可以告诉我在Android Studio中重命名Linphone软件包名称的正确方法。

OR

Is it a good idea to use the Linephone SDK. 使用Linephone SDK是个好主意。 I also have created the linphone.jar (with armeabi-v7a and x86) and placed in lib folder of other project but do not how to use these lib. 我还创建了linphone.jar(带有armeabi-v7a和x86),并将其放置在其他项目的lib文件夹中,但是不知道如何使用这些lib。 in existing project. 在现有项目中。

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. 重命名com前缀时,如果出现错误,请选择“重命名”。 When your finished check compact empty middle packages again and update the applicationID in build.gradle. 完成后,再次检查紧凑的空中间包,并更新build.gradle中的applicationID。 For a more comprehensive guide follow this answer. 有关更全面的指南,请遵循以下答案。

"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." “如果是更改软件包名称的简单问题,请单击软件包浏览器右上角的齿轮符号,然后取消选中紧凑的Empty Middle Packages。您可以右键单击每个单独的软件包名称,进行重构和重命名。重命名时com前缀选择“重命名”(如果发生错误)。完成后再次检查紧凑的空中间包,并更新build.gradle中的applicationID。有关更全面的指南,请遵循此答案。”

No it is not a simple issue! 不,这不是一个简单的问题! at my work we decided to build an app on top of Linphone. 在我的工作中,我们决定在Linphone之上构建一个应用程序。 1. problem change the package name.. ok so i did it, now i can upload the app to Google store! 1.问题更改包名称..好的,所以我做到了,现在我可以将应用程序上传到Google商店了! problem solved? 问题解决了? no!!! 没有!!! if you try to run your app along side with the original linphone app it will crush! 如果您尝试与原始linphone应用程序一起运行您的应用程序,它将崩溃! so ===> it will crush along side any other linphone based app (if the programmers done a bad job). 所以===>它将与其他基于linphone的应用程序同时崩溃(如果程序员做得不好)。

the solution? 解决方案? brute force! 蛮力! change any sub string in the project files named linphone to xxx(xxx=your app name) change all files names containing the name linphone to xxx(xxx=your app name) change all directories names containing name linphone to xxx(xxx=your app name) do the same thing with the string Linphone. 将名为linphone的项目文件中的任何子字符串更改为xxx(xxx =您的应用程序名称)将包含linphone的所有文件名称更改为xxx(xxx =您的应用程序名称)将包含名称linphone的所有目录名称更改为xxx(xxx =您的应用程序)名称)对字符串Linphone做同样的事情。 (capital latter.) (大写字母。)

it took me 3 days! 我花了三天! to solve this, the only solution was the brute force, the only affective way i found to solve the collusion errors. 为了解决这个问题,唯一的解决办法是蛮力,这是我发现解决串谋错误的唯一有效方式。 in my work i used a simple python script to the job.. it is really simple, the hard part was to think about this brute-force solution. 在我的工作中,我使用了一个简单的python脚本来完成工作。这确实很简单,最困难的部分是考虑这种蛮力解决方案。 Good luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM