Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1603517F38 for ; Sun, 2 Nov 2014 20:56:35 +0000 (UTC) Received: (qmail 23156 invoked by uid 500); 2 Nov 2014 20:56:35 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 23139 invoked by uid 500); 2 Nov 2014 20:56:35 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 22947 invoked by uid 99); 2 Nov 2014 20:56:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2014 20:56:34 +0000 Date: Sun, 2 Nov 2014 20:56:34 +0000 (UTC) From: "Rajat Paharia (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CB-7925) Android app crashes when use File Transfer & another plugin that uses SSL (related to OkHttp) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-7925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14194018#comment-14194018 ] Rajat Paharia edited comment on CB-7925 at 11/2/14 8:56 PM: ------------------------------------------------------------ I added the following line: *URL.setURLStreamHandlerFactory(httpClient);* to the top of the *createHttpConnection* function in platforms/android/CordovaLib/src/org/apache/cordova/CordovaResourceApi.java and my app no longer crashes. so the function now looks like: ``` public HttpURLConnection createHttpConnection(Uri uri) throws IOException { URL.setURLStreamHandlerFactory(httpClient); // added assertBackgroundThread(); return httpClient.open(new URL(uri.toString())); } ``` was (Author: rajatrocks): I added the following line: *URL.setURLStreamHandlerFactory(httpClient);* to the top of the createHttpConnection function in platforms/android/CordovaLib/src/org/apache/cordova/CordovaResourceApi.java and my app no longer crashes. so the function now looks like: ``` #!java public HttpURLConnection createHttpConnection(Uri uri) throws IOException { URL.setURLStreamHandlerFactory(httpClient); // added assertBackgroundThread(); return httpClient.open(new URL(uri.toString())); } ``` > Android app crashes when use File Transfer & another plugin that uses SSL (related to OkHttp) > --------------------------------------------------------------------------------------------- > > Key: CB-7925 > URL: https://issues.apache.org/jira/browse/CB-7925 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File Transfer > Affects Versions: 4.0.0 > Environment: Android 4.4.4 > Reporter: Rajat Paharia > > In my app if I do a file upload using the File Transfer plugin and then try to make a call to the Facebook plugin: https://github.com/Wizcorp/phonegap-facebook-plugin - my app immediately crashes. I believe this is caused by this issue with the version of the OkHttp library currently being used: > http://stackoverflow.com/questions/21872818/okhttp-and-facebook-crashed > https://github.com/square/okhttp/issues/184 > It would be great if the described workaround could be implemented in Cordova while we wait for https://issues.apache.org/jira/browse/CB-6630 and an upgrade to OkHttp 2.0 -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org