# Ready, how to build

**URL:** <https://forum.ionicframework.com/t/ready-how-to-build/203238>\
**Category:** Capacitor\
**Created:** [January 21, 2021, 3:48am UTC](https://forum.ionicframework.com/t/ready-how-to-build/203238 "2021-01-21T03:48:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aniee](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Aniee](https://forum.ionicframework.com/u/Aniee)\
**Post date:** [January 21, 2021, 3:48am UTC](https://forum.ionicframework.com/t/ready-how-to-build/203238/1 "2021-01-21T03:48:40Z")

</div>

Please describe the question in detail and share your code, configuration, and other relevant info.

I installed Ionic yesterday on Ubuntu 20.04, so I hope I am using Ionic 5.

Once we set up the HTML, CSS and Angular, what to do next to build the app ?

I tried

`ionic build prod`

`npx cap add android`

but when I try `npx cap open android`

it asks me to add the location of Android Studio’s **studio.sh** file in a particular format inside

`capacitor.config.json`

But doing so brings no change. The project won’t open in _Android Studio_ even if I redo the `npx cap open android` command.

After giving up, I tried open the my-app folder in _Android Studio_ through the GUI and it worked without any problem. It also gives some notifications like _framework found_, _gradle_  
and so on. But when I click `Run`, nothing happens. There is no option to `Build `at all.

It would be nice to know how to get past these and make a successful build. I know this is very trivial for many of you. But I am really finding it hard to build an _apk_ from the completed project. Thanks.

---

<div class="post-metadata">

**Author:** ![Aniee](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Aniee](https://forum.ionicframework.com/u/Aniee)\
**Post date:** [January 21, 2021, 4:37am UTC](https://forum.ionicframework.com/t/ready-how-to-build/203238/2 "2021-01-21T04:37:30Z")

</div>

Look at the irony

 ![Screenshot from 2021-01-21 10-05-20](https://global.discourse-cdn.com/ionicframework/original/3X/0/b/0b41ef8a78ebcc8218e00946515be8c0f6c592c9.png)

I used the output of `ionic capacitor build android` inside _Android Studio_

---

<div class="post-metadata">

**Author:** ![Aniee](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Aniee](https://forum.ionicframework.com/u/Aniee)\
**Post date:** [January 23, 2021, 2:06pm UTC](https://forum.ionicframework.com/t/ready-how-to-build/203238/3 "2021-01-23T14:06:42Z")

</div>

Some help would be great.

---

<div class="post-metadata">

**Author:** ![max](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/max/32/137761_2.png) [@max](https://forum.ionicframework.com/u/max)\
**Post date:** [January 24, 2021, 4:03pm UTC](https://forum.ionicframework.com/t/ready-how-to-build/203238/4 "2021-01-24T16:03:05Z")

</div>

Did you try to run File -\> Sync Project With Gradle Files?

---

<div class="post-metadata">

**Author:** ![Aniee](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Aniee](https://forum.ionicframework.com/u/Aniee)\
**Post date:** [January 24, 2021, 4:24pm UTC](https://forum.ionicframework.com/t/ready-how-to-build/203238/5 "2021-01-24T16:24:33Z")

</div>

No sir, this is where I am now, only 3 commands tried

`ionic prod`

`ionic capacitor add android`

`ionic capacitor build android`

I tried like a no. of videos and blogs that came through Google. Each had their own version. Things go well until I open the project folder in Android Studio. Once it said license not valid for Android 29. I managed to use the SDK Manager and add the necessary dependencies. But it gave something else afterwards.

It would be nice to have a resource where it says the commands in order so that beginners like me can simply imitate. Thanks.

---

<div class="post-metadata">

**Author:** ![max](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/max/32/137761_2.png) [@max](https://forum.ionicframework.com/u/max)\
**Post date:** [January 24, 2021, 4:48pm UTC](https://forum.ionicframework.com/t/ready-how-to-build/203238/6 "2021-01-24T16:48:09Z")

</div>

In Android Studio, if you installed SDK 29, then you should use that menu open that I put above. With Android development, you need to periodically run the Gradle sync, it’s just part of life doing Android dev. We have a list of common troubleshooting tips for Android on the docs: [https://capacitorjs.com/docs/android/troubleshooting](https://capacitorjs.com/docs/android/troubleshooting)

---

<div class="post-metadata">

**Author:** ![Aniee](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Aniee](https://forum.ionicframework.com/u/Aniee)\
**Post date:** [January 24, 2021, 4:52pm UTC](https://forum.ionicframework.com/t/ready-how-to-build/203238/7 "2021-01-24T16:52:42Z")

</div>

Thanks a lot. If you don’t mind. Let us say I have my folders ready. Now I need www and android and then apk. I have so far only tried

ionic start  
ionic serve

Will it be possible to know the commands to use. I guess there would be 3-4 of them. I will simply leave my old attempts and start afresh if I know which commands to use At one point Android Studio told me that there are 6 `AndroidManifest.xml` file and when tried to run the app, it says `AndroidManifest.xml` is missing.

Just sharing my experience so far. 🙂

---

<div class="post-metadata">

**Author:** ![Aniee](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Aniee](https://forum.ionicframework.com/u/Aniee)\
**Post date:** [January 25, 2021, 3:24am UTC](https://forum.ionicframework.com/t/ready-how-to-build/203238/8 "2021-01-25T03:24:53Z")

</div>

Tried to check Ionic version in Terminal

```auto
$ ionic -v
6.12.3

```

**Update** 1:

I managed to get a successful build this time. After finishing HTML code,

`ionic build` for `www` folder generation

`ionic capacitor add android` adds the `android` folder

Opened the `android` folder using Andriod Studio, it performed `Gradle sync` and I tried `Run` which gave a clean output in `AVD`. Then generated a `Signed apk`

All good other than the fact that the links added to `ion-card` are not clickable.

```auto
<ion-card href="https://youtu.be/zcrUCvBD16k">
  <ion-card-header>
    
    <ion-card-title>BBC/ion-card-title>
  </ion-card-header>

  <ion-card-content>
    abc 
  </ion-card-content>
</ion-card>

```
