Crashlytics Initialization ConnectionException(EHOSTUNREACH)

时间:2015-06-18 21:02:07

标签: android crashlytics okhttp twitter-fabric httpexception

我在Android应用上安装了Crashlytics SDK(通过Fabric),之前它运行得很好。突然间,我得到了ConnectionExceptions,而Crashlytics无法与其远程服务器通信。

Fabric在我的Application类的onCreate末尾实例化:

public void onCreate() {
  super.onCreate();
  ...
  Fabric.with(this, new Crashlytics());
}

这是app启动时的堆栈跟踪。有什么想法吗?

06-18 16:53:57.560  15388-15388/? I/Fabric﹕ Initializing Crashlytics 2.3.2.56
06-18 16:54:00.759  15388-15417/com.myapp E/Fabric﹕ Unknown error while loading Crashlytics settings. Crashes will be cached until settings can be retrieved.
    io.fabric.sdk.android.services.network.HttpRequest$HttpRequestException: java.net.ConnectException: failed to connect to settings.crashlytics.com/54.83.37.39 (port 443) after 10000ms: isConnected failed: EHOSTUNREACH (No route to host)
            at io.fabric.sdk.android.services.network.HttpRequest.code(HttpRequest.java:1409)
            at io.fabric.sdk.android.services.settings.DefaultSettingsSpiCall.handleResponse(DefaultSettingsSpiCall.java:96)
            at io.fabric.sdk.android.services.settings.DefaultSettingsSpiCall.invoke(DefaultSettingsSpiCall.java:83)
            at io.fabric.sdk.android.services.settings.DefaultSettingsController.loadSettingsData(DefaultSettingsController.java:80)
            at io.fabric.sdk.android.services.settings.DefaultSettingsController.loadSettingsData(DefaultSettingsController.java:64)
            at io.fabric.sdk.android.services.settings.Settings.loadSettingsData(Settings.java:156)
            at io.fabric.sdk.android.Onboarding.retrieveSettingsData(Onboarding.java:123)
            at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:99)
            at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:45)
            at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:63)
            at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:28)
            at io.fabric.sdk.android.services.concurrency.AsyncTask$2.call(AsyncTask.java:311)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
     Caused by: java.net.ConnectException: failed to connect to settings.crashlytics.com/54.83.37.39 (port 443) after 10000ms: isConnected failed: EHOSTUNREACH (No route to host)
            at libcore.io.IoBridge.isConnected(IoBridge.java:238)
            at libcore.io.IoBridge.connectErrno(IoBridge.java:171)
            at libcore.io.IoBridge.connect(IoBridge.java:122)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:456)
            at java.net.Socket.connect(Socket.java:882)
            at com.android.okhttp.internal.Platform.connectSocket(Platform.java:174)
            at com.android.okhttp.Connection.connect(Connection.java:152)
            at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:276)
            at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:382)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:500)
            at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
            at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
            at io.fabric.sdk.android.services.network.HttpRequest.code(HttpRequest.java:1407)
            at io.fabric.sdk.android.services.settings.DefaultSettingsSpiCall.handleResponse(DefaultSettingsSpiCall.java:96)
            at io.fabric.sdk.android.services.settings.DefaultSettingsSpiCall.invoke(DefaultSettingsSpiCall.java:83)
            at io.fabric.sdk.android.services.settings.DefaultSettingsController.loadSettingsData(DefaultSettingsController.java:80)
            at io.fabric.sdk.android.services.settings.DefaultSettingsController.loadSettingsData(DefaultSettingsController.java:64)
            at io.fabric.sdk.android.services.settings.Settings.loadSettingsData(Settings.java:156)
            at io.fabric.sdk.android.Onboarding.retrieveSettingsData(Onboarding.java:123)
            at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:99)
            at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:45)
            at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:63)
            at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:28)
            at io.fabric.sdk.android.services.concurrency.AsyncTask$2.call(AsyncTask.java:311)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
     Caused by: android.system.ErrnoException: isConnected failed: EHOSTUNREACH (No route to host)
            at libcore.io.IoBridge.isConnected(IoBridge.java:223)
            at libcore.io.IoBridge.connectErrno(IoBridge.java:171)
            at libcore.io.IoBridge.connect(IoBridge.java:122)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:456)
            at java.net.Socket.connect(Socket.java:882)
            at com.android.okhttp.internal.Platform.connectSocket(Platform.java:174)
            at com.android.okhttp.Connection.connect(Connection.java:152)
            at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:276)
            at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:382)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332)
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:500)
            at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
            at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
            at io.fabric.sdk.android.services.network.HttpRequest.code(HttpRequest.java:1407)
            at io.fabric.sdk.android.services.settings.DefaultSettingsSpiCall.handleResponse(DefaultSettingsSpiCall.java:96)
            at io.fabric.sdk.android.services.settings.DefaultSettingsSpiCall.invoke(DefaultSettingsSpiCall.java:83)
            at io.fabric.sdk.android.services.settings.DefaultSettingsController.loadSettingsData(DefaultSettingsController.java:80)
            at io.fabric.sdk.android.services.settings.DefaultSettingsController.loadSettingsData(DefaultSettingsController.java:64)
            at io.fabric.sdk.android.services.settings.Settings.loadSettingsData(Settings.java:156)
            at io.fabric.sdk.android.Onboarding.retrieveSettingsData(Onboarding.java:123)
            at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:99)
            at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:45)
            at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:63)
            at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:28)
            at io.fabric.sdk.android.services.concurrency.AsyncTask$2.call(AsyncTask.java:311)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)

1 个答案:

答案 0 :(得分:1)

我想我弄明白了这个问题。当我使用我当地的Second Cup wifi网络时,似乎只会发生错误。当我使用我的家庭网络时,它可以正常工作。

这里肯定会出现某种代理问题。