There seems to be a small quirk with Cordova 3.6.4. The .apk generated using the CLI is always named CordovaApp as opposed to the name of you project.
This tutorial helps fix that issue by integrating the renaming into your workflow.
You will need to update the following files:
- YourProjectName/platforms/android/AndroidManifest.xml
- YourProjectName/platforms/android/build.xml
- YourProjectName/platforms/android/src/com/yourpackagename/appfolder/CordovaApp.java
NOTE: From the above (file 3), com/yourpackagename/appfolder will correspond to the reverse domain name you used when when set up your application.
STEP 1
Got to the AndroidManifest.xml file and look for:
<activity android:configchanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchmode="singleTop" android:name="CordovaApp" android:screenorientation="portrait" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowsoftinputmode="adjustResize">
Change CordovaApp in android:name=“CordovaApp” to whatever the name of your project is
(android:name=“AwesomeKickAssApp”).
STEP 2:
In the build.xml file locate the following line:
<project name="CordovaApp" default="help">
Change CordovaApp to the name of your project and should match the one in put in step 1 (i.e
name=“AwesomeKickAssApp”).
STEP 3
This stage is abit more tricky and extra caution should be taken when doing this, or else you
might mess things up big time…and that is not Awesome!!
-
Locate the file Cordova.java and rename it to project name (Same as
step 1 and 2…i.e AwesomeKickAssApp.java). -
Open the renamed file and locate the line :
public class CordovaApp extends CordovaActivity change it to the project name like:
public class AwesomeKickAssApp extends CordovaActivity
Sorry to disappoint you but…That’s it!!!
Run the command : ionic build android --release
This should result in:
BUILD SUCCESSFUL
Total time: 8 seconds
Built the following apk(s):
/Path-to-your-project/platforms/android/ant-build/AwesomeKickAssApp-release-unsigned.apk
I hope this saves someone else’s hair, as i pulled out a lot of mine trying to figure this one out.
Refrences:
Stack Overflow Issue
JetBrains confluence page
Saints at play