Home

Follow Skinkers.

 

Blog.

16

Exchange 2010 SP1 and Android error “Unable to open connection to server”

  January 6th, 2011 | Android, Geekery, Tech | Tim Heyes

We recently upgraded our Exchange server from 2003 to 2010 SP1 which has given us some great new features, including the far better web mail which actually works properly on non-IE browsers.

However, for the majority of the Android users in the organisation the change meant that the default email application stopped being able to connect and returned an “Unable to open connection to server” error.
Android error screeshot

The devices/carriers/versions and whether they could connect or not are listed below:

Device Android version ROM Root Carrier Connected
HTC Desire 2.2 HTC Stock No 3 mobile Success
HTC Desire HD 2.2 HTC Stock No Vodafone Success (After OTA update)
HTC Desire HD 2.2 Cyanogenmod 6.1.3 Yes Vodafone Fail
HTC Hero 2.1 HTC Stock No Vodafone Fail
T-Mobile G2 Touch 2.2 Cyanogenmod 6.1 Yes T-mobile Fail
HTC Magic (32B) 2.2 Cyanogenmod 6.0 Yes Vodafone Fail

As you can see, for the device and version combinations there was a mixed bag of results.

Trawling the web it would appear that this is a pretty common occurrence and has seen an outpouring of flak on Google. It looks like this has now been resolved (click here to see the defect status updates from Google) and is in the process of being rolled out.

However, due to the way in which the Android release cycle works, it could be months before this fix manages to work it’s way through to the manufacturers and then the carriers before it hits user’s phones.

As all of us rely on having access to mail from our phones, we needed to find a workaround or fix that could be implemented sooner rather than later.

Exchange workaround

This was a solution that has apparently worked for a number of organisations.

  1. Remove the Android mobile devces affected from each users mailboxes.
  2. Remove the Default (and any other ActiveSync) policy using EMC -- Remove-ActiveSyncMailboxPolicy -id ; setting all users to no activesync policy
  3. Setup the Andriod phones to sync and let them get past the initial synchronization.
  4. Recreate the ActiveSync Policy and set it back to default.

Luckily for us our senior sysadmin, Max, is always willing to get stuck in and try and get a workaround in place (even while muttering “this isn’t a problem on the iPhone” under his breath) and tried this one out for us, but for the Skinkers set up it did not work.

Device workaround

We then came across a post by Alexandros Schillings on his blog with a device based workaround which extracts a working email.apk from an Android emulator instance and installs it on your device.

Every Android user in Skinkers who had this problem (see above) have gone through one of the processes outlined below and in our experience it has been 100% successful.

Requirements:

  • Android SDK with ADB
  • An emulated device (2.1 or 2.2 depending on what your phone is running)
  • Your Android phone

Before attempting any of this, please be aware that we cannot be held responsible for any damage to your device.
Any modifications or tweaks that have been made to your email client by your manufacturer, carrier or ROM creator will be lost as this will be the stock email client from the AOSP ROM.
Finally, if you use the installation method mentioned first, you will overwrite your original email application. If you don’t want this to happen, please follow the second method which requires root access to the phone.

Make sure your phone is plugged and USB debugging is enabled (Settings > Applications > Development > USB Debugging).
Also, make sure your emulator is running (the correct version to match your phone).
Finally, make sure that your phone is set to be able to install applications from unknown sources (Settings > Applications > Unknown Sources)

From a command prompt type:

adb devices

and make sure both your phone and emulator are listed:

adb devices

Next, type:

adb -e pull /system/app/Email.apk

to pull the working email.apk from the emulator into yor current directory (the -e switch directs the command to the emulator as opposed to the device):

adb pull

We now need to install that Email.apk onto your device.

Alexandros’ initial post outlines a method that requires you to have root access on your phone. However, it turns out this is not strictly necessary, and you can simply install the new application over the old one.

From the command prompt, type:

adb -d install Email.apk
adb -d reboot

This worked for our stock 2.1 Hero user, but for the 2.2 G2 Touch running Cyanogenmod 6.1, we get the following error:

G2 error

If this happens, simply revert back to the method of pushing the app that requires root access as follows.

Execute the following commands in sequence:

adb -d remount
adb -d pull /system/app/Email.apk Email.apk.bak
adb -d push Email.apk /system/app/
adb -d remount
adb -d reboot

adb push

This will temporarily remount the system partition as RW, make a backup copy of the original Email.apk to your hard drive (as Email.apk.bak), push the new APK to the device, remount the system partition as RO and finally reboot the device.

That’s it! Now, fire up the email client and enter your Exchange server and account details and you should have your Exchange account ready to sync on your device.

Exchange email working

Once again, all credits go to Alexandros Schillings and his post and comment on the issue page from which the majority of this information was taken.

16 Responses to “Exchange 2010 SP1 and Android error “Unable to open connection to server””

  1. [...] This post was mentioned on Twitter by Tim Heyes. Tim Heyes said: RT @skinkers: New blog post: Exchange 2010 SP1 and Android error "Unable to open connection to server" – http://sknk.rs/ezBSYA [...]

  2. [...] Skinkers Blog] Digg StumbleUpon del.icio.us Facebook Technorati [...]

  3. [...] of problems with the default email client in a lot of Android phones. Well there is some good news, Skinkers Tech Blog has a great article that has resolved a lot of issues with making Android work with Exchange 2010. [...]

  4. [...] Android ja ongelmat Exchange 2010 SP1:n kanssa Monet lukijamme ovat valitelleet niin sähköpostitse, forumilla, kuin blogissakin Exchange-ongelmista Androidin kanssa. Selvitettyämme hieman mistä ongelmat johtuvat, löysimme skinkers.comin artikkelin jossa ollaan painittu kyseisen pähkinän kanssa. Näyttäisi siltä, että suurin murheenkryyni on Exchange 2010 SP1, jonka kanssa he saivat testeissään toimimaan ongelmitta lähinnä HTC:n Desire-perheen, mikäli näissä oli uusin firmware-päivitys. He tarjoavat ongelmaan kahta ratkaisua; palvelinpään, joka on toiminut 90% tapauksista (joka on myös suositeltava ratkaisu) ja puhelimeen tehtävää viritystä, joka onkin sitten jo suuremman luokan propellihattuviritys jota ei suositella tehtäväksi. Ohjeet niitä tarvitseville löytyvät kuitenkin tuttuun tapaan lähdelinkin takaa. Lähde: skinkers.com [...]

  5. [...] If you want the solutions in more depth then check out the article on Skinkers Tech Blog. [...]

  6. Cinen says:

    I had the similar problem with my Samsung Galaxy S and luckily didn’t start doing the workaround. I googled a little more and found Microsoft forum article with ActiveSync issues with iPhone 3Gs & Exchange 2010 RC.

    Here: http://social.technet.microsoft.com/Forums/en/exchange2010/thread/37a1cb86-d4e3-4851-b41b-f8e42997dd6c

    I fixed my problem with users that had AD protected group membership included their user account with only one check box. This probably won’t fix everyones android – exchange 2010 problems, but was worth to try.

    BR. Happy email reader

  7. Shekhar says:

    some of the commands not working in ubuntu
    could you please help to work out them. those commands are:
    adb -d remount
    adb -d pull /system/app/Email.apk Email.apk.bak
    adb -d push Email.apk /system/app/
    adb -d remount
    adb -d reboot

  8. Shekhar says:

    hi dudes
    I have installed calendar.apk to my emulator 2.2 version 8
    but its not running on my system.
    can any one help me to get latest version google calendar.apk for my emulator
    thanks in advance

  9. Ghengist says:

    hello i have try this and the device is wipe and now i am afraid for me.

    please for help?

  10. [...] un correctif, son déploiement est plus ou moins rapide selon les fabricants. L’article suivant résume très bien la [...]

  11. dbobke says:

    I had no issue with my Android 2.3 phone (Nexus S) but I have a Motorola tablet (XOOM) running Honeycomb that would initially connect and sync mail and then quit after a day or so. Same issues noted above and same logging information (PROVISION command issues). I followed the procedure and all appeared to be working but then the sync quit again. I noticed that there was this phantom additional device that showed up as connected to my account that had no ActiveSync policy applied to it. I deleted that device and all was well again. I am not sure why this additional device gets recorded, but if you see it remove it and it seems to correct the issue.

  12. Tim Heyes says:

    Thanks for the info @dbobke – not had any problems with our Honeycomb tablets yet, but we’ll know what to do when it happens!

  13. [...] this error is tied to Exchange 2010 SP1. Here's one site with info including a workaround/fix. Exchange 2010 SP1 and Android error "Unable to open connection to server" I'm not sure if you are trying to sync with an Exchange server but that error seems to be a common [...]

Leave a Reply

*