Android build keeps using CordovaApp as app name


#1

Not sure if this is a bug or something, but this was working few months back, now my every android build gives a default android app like this “CordovaApp-debug.apk”. If I open platforms/android/build.xml I see that xml file starts with <project name="CordovaApp" default="help">.

I guess that for some reason build tool doesn’t take the config.xml name value.

I can probably fix this using the custom_rules.xml and just rename the app after build, but if I check the apps I built few months back they all have their name right.

thanks
dp


App crashes on startup (Android)
Mainactivity.apk
#2

After updating to Cordova 4.0 I am experiencing the same thing.


#3

I’m still on cordova 3.7.0 I searched everywhere and not sure from where is taking this default name


#4

Im getting this to. Its annoying! Tried to remove and then add platforms. Im also on cordova 3.7.0. Fixed it like you said @davor though…

Found any solution?


#5

Same here, I upgraded to Cordova 4.0.0 and I started to see CordovaApp.apk after “build”…

Should I edit it manually meanwhile ?


#6

In android manifest file change this, android:name=“HelloCordova”.


#7

Its funny that it works and I actually tried changing that. be aware that if you ‘platform rm/add’ it will get back to normal, si we can call this workaround till the official fix is released.

thanx gupta!


#8

guys guys guys!! careful when doing this! it crashes the app (on some verisions of android, ex 4.3) on startup if you dont do everything correct.
You have to change the name in android:name in AndroidManifest.xml, the CordovaApp.java file name and its content “class CordovaApp” or you’ll get this error.

see here: https://issues.apache.org/jira/browse/CB-7827


#9

thanks @tobbe I will manually rename it to avoid any issues


#10

There seems to be no reson to change the name though: http://stackoverflow.com/questions/6245858/android-market-and-apk-file-name


#11

It is android platform bug at least in 3.6.* version. But in version 3.5.1 it works good (on windows). So I just did
"> ionic platform add android@3.5.1 --usenpm"


#12

go to the following path:

C:\Users\[Your Username]\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\lib

open create.js and edit line 217

var safe_activity_name = "CordovaApp"

to be

var safe_activity_name = project_name.replace(/\W/g, ''); 

and everything will be working like before.


#13

Its not working…I did that and still getting CordovaApp-debug file name


#14

I was able to change the apk name during the zipalign step:

zipalign -v 4 CordovaApp-release-unsigned.apk MyOwnName.apk

and this seems to work.


#15

Hi Guys.

I have just added a work around for this in the tutorials section:

Renaming android .apk from CordovaApp to your app name

I have built and tested my app and everything seems to be working just fine.

:wink:


#16

Check out the blog post:

Renaming android .apk from CordovaApp to your app name

I hope this eases you pain. :sunny:


#17

Thanks @munyanyika It works for me.


#18

Hi @tobbe you can change the apk name safely, I have added a tutorial to that effect Renaming android .apk from CordovaApp to your app name

Regards


#19

Hi, yea! I usually do it like @sakotturi said though: zipalign -v 4 CordovaApp-release-unsigned.apk MyOwnName.apk - less typing :stuck_out_tongue:


#20

How to Renaming/Change App Name HelloCordova/HelloAndroid/HelloIonic in an Ionic App

Go to: http://solutionfrominternet.blogspot.com/2015/01/how-to-renamingchange-app-name.html