# Could not build a production release for android

**URL:** <https://forum.ionicframework.com/t/could-not-build-a-production-release-for-android/76766>\
**Category:** ionic-v3\
**Created:** [January 19, 2017, 5:29pm UTC](https://forum.ionicframework.com/t/could-not-build-a-production-release-for-android/76766 "2017-01-19T17:29:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vohtaski](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/vohtaski/32/100003_2.png) [@vohtaski](https://forum.ionicframework.com/u/vohtaski)\
**Post date:** [January 19, 2017, 5:29pm UTC](https://forum.ionicframework.com/t/could-not-build-a-production-release-for-android/76766/1 "2017-01-19T17:29:34Z")

</div>

I am trying to build a production up with this command:

```
ionic build android --prod

```

However it fails with the error below:

```
@HOME ~/ ***/*** -app(master)$ ionic build ios --prod

> ***-app@ ionic:build /Users/evgeny/*** /***-app
> ionic-app-scripts build "--prod"

[18:26:09] ionic-app-scripts 1.0.0
[18:26:09] build prod started ...
[18:26:09] clean started ...
[18:26:09] clean finished in 1 ms
[18:26:09] copy started ...
[18:26:09] ngc started ...
[18:26:19] ngc finished in 10.06 s
[18:26:19] rollup started ...
[18:26:20] rollup failed: Could not resolve entry (undefined/app/main.prod.ts)
[18:26:20] ionic-app-script task: "build"
[18:26:20] Error: Could not resolve entry (undefined/app/main.prod.ts)
Error: Could not resolve entry (undefined/app/main.prod.ts)
    at /Users/evgeny/ ***/*** -app/node_modules/rollup/dist/rollup.js:8693:28

```

Any idea why?

```
Your system information:

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.11
OS: macOS Sierra
Node Version: v6.9.3
Xcode version: Xcode 8.2.1 Build version 8C1002
```

---

<div class="post-metadata">

**Author:** ![vohtaski](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/vohtaski/32/100003_2.png) [@vohtaski](https://forum.ionicframework.com/u/vohtaski)\
**Post date:** [January 23, 2017, 1:02pm UTC](https://forum.ionicframework.com/t/could-not-build-a-production-release-for-android/76766/2 "2017-01-23T13:02:46Z")

</div>

The problem is with custom rollup.config.js that had the following lines:

```
if (process.env.IONIC_ENV == 'prod') {
  // production mode
  rollupConfig.entry = '{{TMP}}/app/main.prod.ts';
  rollupConfig.sourceMap = false;
}
```
