How to create apk using angular 5 + cordova

1)install cordova cli explain

2)create cordova project

3)install platform (if you get error run in the project “cordova platform” you will see all platforms, and then run again install platform

4)now we need to merge the angular project to the cordova project
we run in angular

ng build --prod --base-href .

5)every files that we will get in the dist folder on angular project we copy them to www folder in the cordova project
6)go to www folder and  run cordova build android from cmd
after he finish you will see the path where he create the apk file
during this command i can get couple of errors

  • – for example i miss jdk
    this the version i need 171

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

8u171 

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  • – i can get that i miss licensee(for java)

i need to run
cd C:\Users\a1_sh\AppData\Local\Android\Sdk\tools\bin\
sdkmanager –licenses

i write this tutrial based on mix of these posts
https://stackoverflow.com/questions/44511473/how-can-i-build-angular2-cli-project-to-cordova-build-android

and

View story at Medium.com

Advertisements
This entry was posted in כללי and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s