I have an android phonegap project, and an ios phonegap project.
They were created using a given package name, but I now have to change this package name.
In Android, I think I have to change package name in manifest, plus rename/move the java file in the src folder, and change inside this java file to reflect the new package name. Then clean and build. Does this sound right?
I also noticed an option in Eclipse Android Tools >> Rename Application Package, where it asks for a package name. Would it make all necessary changes?
How would I change the bundle ID in the XCode project so the project builds ok? Just edit the Bundle identifier as explained in this ticket would do? Changing xcode package name without creating and importing to new project
Thanks for any help.
It would be better if instead of Renaming the .java file and the class name, you just make your changes in:
Then remove android support with cordova platform remove android
And then re-add the android support cordova platform add android
This will generate the .java file again with the correct name.
Ref: http://intown.biz/2014/03/07/renaming-a-cordova-application/
As a command above, just 3 steps:
Remove platform cordova platform remove android
Edit config.xml (main folder) find & replace widget id
<widget id="com.foobar.mynewname" version="1.0.0" android-versionCode="1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
cordova platform add android
Yes, basically just change the android:package attribute in your manifest, and then refactor your src/ folders to follow that same package name.
As an alternative you can use the rename option in Eclipse, but it will have to modify all of the R.class imports in any of your java files that use resources. This will look a little intimidating, but should work fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With