Ionic toturial for building a release.apk


#41

The tutorial is a year old. Apache Cordova no longer uses Ant. It won’t work now.

Regards,


#42

You should no longer use ant.properties and secure.properties you should create a “release-signing.properties” file with these contents:

key.store=YourApp.keystore
key.store.password=
key.alias=YourApp
key.alias.password=

no custom-rules.xml just the release-signign.properties and the key.store file then use ionic build --release
only these steps if your ionic version is up to date

You should no longer use ant.properties and secure.properties you should create a
"release-signing.properties" file with these contents:

key.store=YourApp.keystore
key.store.password=
key.alias=YourApp
key.alias.password=
no custom-rules.xml just the release-signign.properties and the key.store file
then use ionic build --release


#43

Where exactly does this release-signing.properties go?

I have ionic 1.2.4 and cordova-cli 6.0 with cordova-android 5.1.0 and each time I build, the file gets deleted from /path-to-my-app/platforms/android :sob:


#44

I cannot get this to work, even with the newer gradle config. It complains “Keystore was tampered with, or password was incorrect” but I know thats not the case. I can upload that keystore onto ionic and use ionic package and it works fine. But I need to build a release version locally so I can force debug on, because for some reason when I make the release build my app can’t access its backend API which works fine in all other cases…


#46

hi…!
after completion of these steps i am unable to get signed apk instead i get unsigned apk
What more changes do i need to do?


#47

how to create simple apk file in ionic framework using without any software


#48

@sjerd Could you please update the original post with these instructions? There are almost 50 comments and I guess that not everyone reads all of them to find somewhere in between that half of the instructions in the original tutorial are obsolete. And this is still one of the top results in Google for “ionic build release”.


#49

Yes but for some reason I can’t edit the original post. The edit button is missing.


#50

Brother please help.
I am trying to build android using ionic from a week but not resolve below issue.

What went wrong:
A problem occurred configuring root project ‘android’.

A problem occurred configuring project ‘:CordovaLib’.
Could not resolve all dependencies for configuration ‘:CordovaLib:classpath
’.
Could not resolve com.android.tools.build:gradle:1.5.0.
Required by:
android:CordovaLib:unspecified
Could not HEAD ‘https://repo1.maven.org/maven2/com/android/tools/buil
d/gradle/1.5.0/gradle-1.5.0.pom’.
peer not authenticated
Error: Error code 1 for command: cmd with args: /s,/c,"“E:\Ionic Development\MyI
rritatingP\platforms\android\gradlew” cdvBuildRelease -b “E:\Ionic Development\M
yIrritatingP\platforms\android\build.gradle” -Dorg.gradle.daemon=true -Pandroid.
useDeprecatedNdk=true"

Somebody please help


#51

Try updating your android sdk tools had same kind of error.


#52

Hello sjerd ,
Thanks for your instant reply… actually there was problem in environment variable. And I done it…
Thank you so much.


#53

I followed steps given above for release apk. It created release apk file but when I try to install this in my mobile, it give me error “There is a Problem Parsing the Package.”. Please guide me what more need to change OR what is going wrong here?


#54

anyone know where custom_rules.xml is? I did a project-wide search and did not find it.


Looking for help compiling my existing ionic app into an Android app
#55

It uses another build method now, search this thread i’ve mentioned it a couple times. I also added the new method as an answer to this thread.


#56

Hi,
thanks a lot.
I am new to Ionic, I have an ionic app.
I have created build for that
ionic build android
and i got debug.apk
now I need Singed apk so that i can use it on play store.

I found this tutorial but it wont help me a lot.
What i have-

** ionic CLI v2.0.0-beta.31
java version "1.7.0_21",
cordova-  6.2.0,
node-   v6.2.2,
npm -v   3.9.5,**

=> I am unable to use Ionic toturial for building a release.apk to have some help,

=> then I follow this http://cordova.apache.org/docs/en/dev/guide/platforms/android/index.html#using-buildjson
=> also seen this

  1. create a file in project root directory with name build.json
  2. insert details as
    {
    “android”: {
    “release”: {
    “keystore”: “android.keystore”,
    “storePassword”: “storepassword”,
    “alias”: “mykey”,
    “password” : “password”,
    “keystoreType”: “”
    }
    }
    }
  3. run
    cordova build android --release

Now i have issue as-
Reading build config file: /Users/some/project/files/build.json
Error: Unexpected token / in JSON at position 0
Don’t know how to solve this and get signed apk for my app.


#57

Hi
After typing that command line :
keytool -genkey -v -keystore YourApp.keystore -alias YourApp -keyalg RSA -keysize 2048 -validity 10000

I get that message on windows cmd:

‘keytool’ n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

Which means that keytool is not a recognized command.

May I have a help please?


#58

Sorry but someone should say it… The title says “toturial” :stuck_out_tongue:
Goot tUto tho! :wink:


#59

On running ionic build android --release i’m getting this eror
BUILD FAILED

Total time: 3.55 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘android’.

You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 24].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    Picked up _JAVA_OPTIONS: -Xmx512M

#60

Are you sure your Android SDK is up-to-date? Try running android in your cmd and see if you need to install any packages.


#61

i get the apk-release file but when i try to install on my phone it says install failed. any idea whats wrong?
previously when apk was not signed properly build used to fail but this time build passed means it was signed properly. I have no clue why install fails.