Android Google Calendar "Unable to launch event"
<p><strong>Case 1</strong>
I have hosted a calendar event iCal <strong>.ics</strong> file on Amazon AWS and the HTTP URL to the same is integrated within my Android app.</p>

<p><a href="https://s3-ap-southeast-1.amazonaws.com/endcards/calendar/World_Television_Premiere_of_House_Of_Cards_March_1213_5pm_on_Zee_Cafe.ics" rel="noreferrer">Here is the file</a></p>

<p>When the user clicks on URL, an intent chooser is displayed with following options:</p>

<ul>
<li>Calendar apps</li>
<li>Browsers to download file</li>
</ul>

<p>When I select Google Calendar, it gives me an error that says "Unable to launch event"</p>

<p>When I select Chrome, the file get's downloaded and when the user clicks on downloaded file it gives same error "Unable to launch event"</p>

<p>Following are the response headers when the file is downloaded using a desktop chrome http client Postman</p>

<pre><code>Accept-Ranges → bytes
Content-Length → 959
Content-Type → application/octet-stream
Date → Thu, 10 Mar 2016 13:45:10 GMT
ETag → "5d48719213395a28e09e8adf01f6ce83"
Last-Modified → Wed, 09 Mar 2016 15:24:22 GMT
Server → AmazonS3
x-amz-id-2 → XXXXXXXXXXXXXXXXXXXXXXXXX
x-amz-request-id → XXXXXXXXXXXXXXXXXXX
</code></pre>

<p><strong>Case 2</strong>
To experiment, I wrote a simple PHP script on my local Apache server to download the same file instead of directly accessing file from HTTP URL</p>

<p>PHP Code</p>

<pre><code>&lt;?php
$file = $_GET['file'];
if (file_exists($file)) {
        header('Content-Description: File Transfer');
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename='.basename($file));
        header('Content-Transfer-Encoding: binary');
        header('Expires: 0');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Pragma: public');
        header('Content-Length: ' . filesize($file));
        ob_clean();
        flush();
        readfile($file);
        exit;
    }
?&gt;
</code></pre>

<p>The file got downloaded successfully and then</p>

<ul>
<li>Downloaded file is clicked</li>
<li>Google calendar is selected from intent chooser</li>
<li>Event is added successfully in google calendar</li>
</ul>

<p>Following are the response headers when using PHP script</p>

<pre><code>Cache-Control → must-revalidate, post-check=0, pre-check=0
Connection → Keep-Alive
Content-Description → File Transfer
Content-Disposition → attachment; filename=World_Television_Premiere_of_House_Of_Cards_March_1213_5pm_on_Zee_Cafe.ics
Content-Length → 959
Content-Transfer-Encoding → binary
Content-Type → application/octet-stream
Date → Thu, 10 Mar 2016 07:27:15 GMT
Expires → 0
Keep-Alive → timeout=5, max=100
Pragma → public
Server → Apache/2.4.7 (Ubuntu)
X-Powered-By → PHP/5.5.9-1ubuntu4.14
</code></pre>

<p>Can any one please help to understand why the event is not saved or working for case 1??</p>

<p>Thanks in advance.
Please help.</p>

<p><strong>Edit</strong></p>

<p>Android Device: Nexus 6 (6.0.1)</p>

<p>Google Calendar App: 5.3.6-115544951-release</p>