# Unable to build a bundle

**URL:** <https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807>\
**Category:** Technical Support\
**Tags:** android\
**Created:** [March 31, 2022, 3:16pm UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807 "2022-03-31T15:16:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![raf](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/r/848f3c/32.png) [@raf](https://forum.communityhealthtoolkit.org/u/raf)\
**Post date:** [March 31, 2022, 3:16pm UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/1 "2022-03-31T15:16:36Z")

</div>

Dear all,

I am building a `cht-android` flavor as described in the [documentation](https://docs.communityhealthtoolkit.org/core/guides/android/branding/#1-required-resources)

I have successfully build the `apk`s for Webview and for lower Android version. When building the bundle with the command

> make org=new\_brand flavor=New\_brand bundle

I get the error message

> bundleNew\_flavorRelease not found in root project ‘cht-android’

Such a file is indeed not there, but when was it supposed to be created?

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [March 31, 2022, 4:13pm UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/2 "2022-03-31T16:13:40Z")

</div>

Can you double-check that you have added your `New_brand` config to the build.gradle in the `android/productFlavors` section (as described [in step 2.2](https://docs.communityhealthtoolkit.org/core/guides/android/branding/#2-new-brand))?

If this is missing or does not match the flavor you are using in the `bundle` command, it could cause the error you are seeing.

---

<div class="post-metadata">

**Author:** ![raf](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/r/848f3c/32.png) [@raf](https://forum.communityhealthtoolkit.org/u/raf)\
**Post date:** [March 31, 2022, 4:37pm UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/3 "2022-03-31T16:37:36Z")

</div>

Dear @jkuester,

yes I have the entry:

> new\_flavor {  
> dimension = ‘brand’  
> applicationID = ‘org.medicmobile.webapp.mobile.new\_flavor’  
> }

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [March 31, 2022, 7:49pm UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/4 "2022-03-31T19:49:03Z")

</div>

Okay, so we must have something weirder going on… Another thing to double-check is if you have the `ANDROID_HOME` environment variable properly set as described here: [https://docs.communityhealthtoolkit.org/contribute/code/android/development-setup/](https://docs.communityhealthtoolkit.org/core/guides/android/development-setup/#android-studio-and-the-sdk).

If that is setup properly and it still does not work, you could try forcing gradle to rebuild its cache for the project (just in case something has been corrupted in there). From within your `cht-android` directory, run `mv .gradle backup.gradle`

If none of that works, it would be helpful if you could post the complete output for your `make org=new_brand flavor=New_brand bundle` command.

---

<div class="post-metadata">

**Author:** ![raf](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/r/848f3c/32.png) [@raf](https://forum.communityhealthtoolkit.org/u/raf)\
**Post date:** [March 31, 2022, 10:50pm UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/5 "2022-03-31T22:50:20Z")

</div>

@jkuester  
before digging deeper, could you please clarify that the path of the generated apks is correct?  
According to the documentation, the files should have been created in

> build/outputs/apk/new\_brand/release/

In my case the files are in :

> build/outputs/apk/new\_brand/release/new\_brandWebview/release

and

> build/outputs/apk/new\_brand/release/new\_brandXwalk/release

I assume that the bundle command is accessing the apks to make the bundle, so that path probably matters.

---

<div class="post-metadata">

**Author:** ![raf](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/r/848f3c/32.png) [@raf](https://forum.communityhealthtoolkit.org/u/raf)\
**Post date:** [March 31, 2022, 10:54pm UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/6 "2022-03-31T22:54:16Z")

</div>

> [@jkuester](#):
>
> mv .gradle backup.gradle

Dear @jkuester your suggested solutions did not help, unfortunately.  
Yes, ANDROID\_HOME is properly set. I have moved `.gradle`

Please find the output of the `bundle` command (revealing the encryption)

> ANDROID\_KEYSTORE\_PATH=msfecare.keystore ANDROID\_KEY\_ALIAS=medicmobile   
> ANDROID\_KEYSTORE\_PASSWORD=4cdc7f5096ac71e5 ANDROID\_KEY\_PASSWORD=4cdc7f5096ac71e5   
> ./gradlew --daemon --parallel bundleMsfecareRelease

> Configure project :  
> WARNING:Using flatDir should be avoided because it doesn’t support any meta-data formats.

FAILURE: Build failed with an exception.

- What went wrong:  
Task ‘bundleMsfecareRelease’ not found in root project ‘cht-android’.

- Try:

> Run gradlew tasks to get a list of available tasks.  
> Run with --stacktrace option to get the stack trace.  
> Run with --info or --debug option to get more log output.  
> Run with --scan to get full insights.

- Get more help at [https://help.gradle.org](https://help.gradle.org)

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See [Command-Line Interface](https://docs.gradle.org/7.3/userguide/command_line_interface.html#sec:command_line_warnings)

BUILD FAILED in 2s  
make: \*\*\* [Makefile:54: bundle] Error 1

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [April 1, 2022, 4:39pm UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/7 "2022-04-01T16:39:23Z")

</div>

Okay, wait, I think I know what is going on here. Is the branch for you new branded based on a previous tag of `cht-android` (such as `v0.11.1`)? If so, you will also need to include the the version (`Webview`/`Xwalk`) as part of your `flavor` that you provide to `make ... bundle`.

E.g.: `make flavor=New_brandWebview bundle`

The source of my confusion was that in the upcoming `v1.0.0` of `cht-android` we are removing the separate versions and so if you happen to be testing things while on the `master` branch (like I was) then `make flavor=New_brand bundle` should work without the extra version notation…

Note that it is correct to base the branch for your new bundle off of the last released version (as mentioned in the [documentation](https://docs.communityhealthtoolkit.org/core/guides/android/branding/#2-new-brand)) and not off `master`. Just realize that with the new major version of `cht-android`, this bundle command will be changing. @Jennifer_Quesada feel free to jump in here and correct me if I am wrong or add anything I missed!

---

<div class="post-metadata">

**Author:** ![ewafula](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/ewafula/32/1732_2.png) [@ewafula](https://forum.communityhealthtoolkit.org/u/ewafula)\
**Post date:** [February 24, 2023, 8:55am UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/8 "2023-02-24T08:55:45Z")

</div>

Hi @jkuester  
I’m running into this same problem.  
I was base to base my branch to v1.0.4 however I’m getting the following error.  
FAILURE: Build failed with an exception.

- What went wrong:  
Task ‘assemblesearch\_cht’ not found in root project ‘cht-android’.

- Try:

> Run gradlew tasks to get a list of available tasks.  
> Run with --stacktrace option to get the stack trace.  
> Run with --info or --debug option to get more log output.  
> Run with --scan to get full insights.

- Get more help at [https://help.gradle.org](https://help.gradle.org)

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See [Command-Line Interface](https://docs.gradle.org/7.3/userguide/command_line_interface.html#sec:command_line_warnings)

BUILD FAILED in 3s  
make: \*\*\* [Makefile:42: assemble] Error 1

Kindly note that I added my new flavor into into build.gradle,  
Any insights on what I might be missing out.  
Thank you.  
Erick

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [February 24, 2023, 2:58pm UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/9 "2023-02-24T14:58:13Z")

</div>

If you run `./gradlew tasks` do you see `assemblesearch_cht` in the list of “Build tasks”?

Can you share the exact `make` command you are running when you get this error?

---

<div class="post-metadata">

**Author:** ![ewafula](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/ewafula/32/1732_2.png) [@ewafula](https://forum.communityhealthtoolkit.org/u/ewafula)\
**Post date:** [February 25, 2023, 4:01am UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/10 "2023-02-25T04:01:30Z")

</div>

Hi the the command  
make flavor=search\_cht assemble  
I’ve executed `/gradlew tasks` and I can’t see `assemblesearch_cht` in the list of “Build tasks”.  
Thank you.  
Erick

---

<div class="post-metadata">

**Author:** ![ewafula](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/ewafula/32/1732_2.png) [@ewafula](https://forum.communityhealthtoolkit.org/u/ewafula)\
**Post date:** [February 27, 2023, 10:44am UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/11 "2023-02-27T10:44:09Z")

</div>

I’ve seen the error I was making, and I’m now able to see assemblesearch\_cht on the list of task.  
Thank you.

Erick

---

<div class="post-metadata">

**Author:** ![ewafula](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/ewafula/32/1732_2.png) [@ewafula](https://forum.communityhealthtoolkit.org/u/ewafula)\
**Post date:** [February 28, 2023, 5:11am UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/12 "2023-02-28T05:11:00Z")

</div>

Hi,  
My app bundles very well and generates the required APK.  
However when I install the apk on my android phone or the android emulator. The app is not displaying any page.  
Kindly let me if I might have missed anything in this configuration

```auto
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Search Cht</string>
    <string name="app_host">URL of the host server</string>
</resources>

```

Is the configuration of “app\_host” ok?  
Thank you.  
Erick

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [March 3, 2023, 3:45pm UTC](https://forum.communityhealthtoolkit.org/t/unable-to-build-a-bundle/1807/13 "2023-03-03T15:45:52Z")

</div>

Sorry for the delayed response! That `strings.xml` should be fine as long as `URL of the host server` is actually a real URL for your server! For example:

```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
	<string name="app_name">Medic (gamma)</string>
	<string name="app_host">gamma.dev.medicmobile.org</string>
</resources>

```

> The app is not displaying any page.

Do you mean that you cannot see the app at all on the device, or that nothing is displayed when openning the app?
