2014-07-06 332 views
5

我在啓動我的應用程序時收到以下錯誤。使用插件配置Crashlytics - 存在build.gradle,AndroidManifest.xml,crashlytics.properties中的相應條目。從我的應用程序類啓動Crashlytics。我每次都得到這個。我不是在代理或任何東西后面。Crashlytics連接被拒絕 - 連接失敗無法連接到api.crashlytics.com

E/Crashlytics﹕ Error performing auto configuration. 
com.crashlytics.android.internal.aD: java.net.ConnectException: failed to connect to api.crashlytics.com/127.0.0.1 (port 443) after 10000ms: isConnected failed: ECONNREFUSED (Connection refused) 
     at com.crashlytics.android.internal.ay.a(SourceFile:2582) 
     at com.crashlytics.android.internal.ay.b(SourceFile:2562) 
     at com.crashlytics.android.internal.ay.b(SourceFile:2548) 
     at com.crashlytics.android.a.a(SourceFile:81) 
     at com.crashlytics.android.a.a(SourceFile:50) 
     at com.crashlytics.android.Crashlytics.a(SourceFile:895) 
     at com.crashlytics.android.Crashlytics.a(SourceFile:54) 
     at com.crashlytics.android.t.a(SourceFile:839) 
     at com.crashlytics.android.internal.aa.run(SourceFile:13) 
     at java.lang.Thread.run(Thread.java:841) 
Caused by: java.net.ConnectException: failed to connect to api.crashlytics.com/127.0.0.1 (port 443) after 10000ms: isConnected failed: ECONNREFUSED (Connection refused) 
     at libcore.io.IoBridge.isConnected(IoBridge.java:223) 
     at libcore.io.IoBridge.connectErrno(IoBridge.java:161) 
     at libcore.io.IoBridge.connect(IoBridge.java:112) 
     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192) 
     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459) 
     at java.net.Socket.connect(Socket.java:843) 
     at com.android.okhttp.internal.Platform.connectSocket(Platform.java:131) 
     at com.android.okhttp.Connection.connect(Connection.java:101) 
     at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294) 
     at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255) 
     at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206) 
     at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345) 
     at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:89) 
     at com.android.okhttp.internal.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:197) 
     at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:254) 
     at com.crashlytics.android.internal.ay.i(SourceFile:2486) 
     at com.crashlytics.android.internal.ay.j(SourceFile:2499) 

回答

12

Hemal from Crashlytics here。你能否檢查是否有任何阻止廣告的軟件干擾連接?

+2

嗨@hemal我用織物crashlytics並得到了與問題相同的錯誤。我確信我的手機中沒有任何阻止廣告的軟件。但任何想法解決這個?? –

4

面對同樣的問題,AdAway阻止了crashlytics.com。只需將此主機添加到白名單。

1

檢查您的設備是否安裝了任何類型的廣告攔截軟件,或者您的主機文件被修改爲阻止廣告。 如果您的設備已經生根,那麼您可以檢查/ etc/hosts下的「127.0.0.1 crashlytics.com」行的hosts文件。可能這條線導致了這個問題。

將crashlytics.com添加到AdAway白名單並測試您的應用。

乾杯

5

我有小蜜M4同樣的問題。如上所述,如果您沒有任何廣告攔截應用程序,那麼主要原因是/ets/hosts文件。

您可以檢查命令行這個猜測:

adb shell # run a shell there 
cat /etc/hosts | grep crashlytics # print file content and filter it by 'crashlytics' word 

,如果你看到這樣的行這個列表那麼它的您正在尋找這個問題:

127.0.0.1 api.crashlytics.com 
127.0.0.1 apps.crashlytics.com 
127.0.0.1 beta.crashlytics.com 
127.0.0.1 blog.crashlytics.com 
127.0.0.1 calendar.crashlytics.com 
127.0.0.1 crashlytics.com 
127.0.0.1 docs.crashlytics.com 
127.0.0.1 download.crashlytics.com 
127.0.0.1 e.crashlytics.com 
127.0.0.1 report.crashlytics.com 
127.0.0.1 reports.crashlytics.com 
127.0.0.1 settings.crashlytics.com 
127.0.0.1 support.crashlytics.com 
127.0.0.1 try.crashlytics.com 
127.0.0.1 www.crashlytics.com 

爲了解決這個問題問題你應該評論他們。這個想法怎麼做,我發現here,但我無法編輯vi文件。所以我只是拉,更改並推回hosts文件。注意:你的設備必須根植於此。

​​

只是註釋行是這樣的:

#127.0.0.1 api.crashlytics.com 
#127.0.0.1 apps.crashlytics.com 
#127.0.0.1 beta.crashlytics.com 
#127.0.0.1 blog.crashlytics.com 
#127.0.0.1 calendar.crashlytics.com 
#127.0.0.1 crashlytics.com 
#127.0.0.1 docs.crashlytics.com 
#127.0.0.1 download.crashlytics.com 
#127.0.0.1 e.crashlytics.com 
#127.0.0.1 report.crashlytics.com 
#127.0.0.1 reports.crashlytics.com 
#127.0.0.1 settings.crashlytics.com 
#127.0.0.1 support.crashlytics.com 
#127.0.0.1 try.crashlytics.com 
#127.0.0.1 www.crashlytics.com 

你不能將其推回沒有根規則。所以將它推入一些TMP用戶目錄:

adb push ./<your_computer_directory>/hosts /mnt/sdcard/hosts 

然後以root身份進入並更換/etc/hosts文件:

adb shell # run a shell there 
su # become the root (don't miss confirmation request!) 
mount -o remount,rw /system # allow to write 
cp /mnt/sdcard/hosts /etc/hosts 
rm /mnt/sdcard/hosts 
mount -o remount,ro /system # get things back to normal 
exit # unroot 
nslookup YourBlockedAdSite.Net # check if it works 
exit # good bye 

利潤!

相關問題