Monday, October 16, 2017

Not able to install android apk with duplicate code

Leave a Comment

I build a hybrid app(android) using ionic v-1 and angular 1.
It is working fine, i uploaded that in play store.

Now i copied the same code and making a new app.
I changed the name and package path.
But i am not able to install new app when first one is already installed in system.
Please help what i need to change ?

3 Answers

Answers 1

As you mentioned that you are using an existing code base , you need to change the Id name in your config.xml

Example config.xml

<widget id="com.ionicapp.yournewapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">     <name>thisis the name that needs to replaced</name>     <!-- Content removed for brevity --> </widget> 

After changing the ID , you need to delete your Platform folder and rebuild it with the modified Config.xml , in such way you will not face any errors

Answers 2

Changing the name is not enough. You have to also change your app id to something unique in app stores. The CLI has no option to change the id of existing apps, you have to edit config.xml manually

Example config.xml

<widget id="com.ionicbyrequest.mynewapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">     <name>MyNewApp</name>     <!-- Content removed for clarity --> </widget> 

You have to change the id attribute of widget tag to change your app id.

Answers 3

Just need to chnage android-versionCode="1" to android-versionCode="2" every time while deploying same app to play store.

<widget id="com.ionicapp_Old.yournewapp" version="1.7.9" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" android-versionCode="1"> </widget> 

to change to new app you must have new app id and name of your app also for version change reflect in play store change the version tag.

  <widget id="com.ionicapp_New.yournewapp" version="1.7.9" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" android-versionCode="1">  <name>whatever you want</name>     </widget> 
If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment