# Problem building android app from source

**URL:** <https://community.openhab.org/t/problem-building-android-app-from-source/8327>\
**Category:** Android App\
**Created:** [March 5, 2016, 2:21pm UTC](https://community.openhab.org/t/problem-building-android-app-from-source/8327 "2016-03-05T14:21:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hazze](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/f19dbf/32.png) [@hazze](https://community.openhab.org/u/hazze)\
**Post date:** [March 5, 2016, 2:21pm UTC](https://community.openhab.org/t/problem-building-android-app-from-source/8327/1 "2016-03-05T14:21:23Z")

</div>

Hi, I’ve problems building the android app from source.  
I’m getting an exception: “com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”.

Has anyone manage to build the master version of habdroid without problems?

I have a fix that will allow me to build, but I’m not sure if that is a correct fix: [Step android gradle plugin version to 1.5.0 · hazzeh/openhab.android@9913fbe · GitHub](http://github.com/hazzeh/openhab.android/commit/9913fbe5d7f774f7b197f5f45a1b23349a38d4d4)  
This commit also steps the android gradle plugin version to one that is accepted by newer android studio versions.  
If it is a valid correction I can create a pull request.

BR,  
Hans

---

<div class="post-metadata">

**Author:** ![slawekjaranowski](https://community.openhab.org/user_avatar/community.openhab.org/slawekjaranowski/32/70784_2.png) [@slawekjaranowski](https://community.openhab.org/u/slawekjaranowski)\
**Post date:** [March 13, 2016, 1:32pm UTC](https://community.openhab.org/t/problem-building-android-app-from-source/8327/2 "2016-03-13T13:32:48Z")

</div>

I had the same error, adding  
`multiDexEnabled true` resolve compilation problem.

We also should change extends of `org.openhab.habdroid.core.HABDroid` to `android.support.multidex.MultiDexApplication` to support older version of Android.

---

<div class="post-metadata">

**Author:** ![slawekjaranowski](https://community.openhab.org/user_avatar/community.openhab.org/slawekjaranowski/32/70784_2.png) [@slawekjaranowski](https://community.openhab.org/u/slawekjaranowski)\
**Post date:** [March 15, 2016, 11:46pm UTC](https://community.openhab.org/t/problem-building-android-app-from-source/8327/3 "2016-03-15T23:46:35Z")

</div>

I prepared similar commit:

> <https://github.com/openhab/openhab-android/pull/158>
>
> Fix #147, #155

@maintainer - does anybody maintain android project? - I see only one @belovictor

---

<div class="post-metadata">

**Author:** ![hazze](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/f19dbf/32.png) [@hazze](https://community.openhab.org/u/hazze)\
**Post date:** [March 18, 2016, 2:17pm UTC](https://community.openhab.org/t/problem-building-android-app-from-source/8327/4 "2016-03-18T14:17:43Z")

</div>

That looks good, it would be nice if it can be merged into master. Then I can rebase my pull requests for fixing issue #153.
