AndroidVideoCache: Error pinging server
In some cases local server cache proxy is not pinged. One known problem is system proxy in connection’s settings (wi-fi or apn). May be some another reasons exist. Typical stacktrace is
E/Pinger: Error reading ping response
com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:52645/ping with offset 0
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:86)
at com.danikula.videocache.Pinger.access$100(Pinger.java:28)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.io.FileNotFoundException: http://127.0.0.1:52645/ping
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:238)
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:70)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:86)
at com.danikula.videocache.Pinger.access$100(Pinger.java:28)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
E/Pinger: Error reading ping response
com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:52645/ping with offset 0
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:86)
at com.danikula.videocache.Pinger.access$100(Pinger.java:28)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.io.FileNotFoundException: http://127.0.0.1:52645/ping
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:238)
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:70)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:86)
at com.danikula.videocache.Pinger.access$100(Pinger.java:28)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
E/Pinger: Error reading ping response
com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:52645/ping with offset 0
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:86)
at com.danikula.videocache.Pinger.access$100(Pinger.java:28)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.io.FileNotFoundException: http://127.0.0.1:52645/ping
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:238)
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:70)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:86)
at com.danikula.videocache.Pinger.access$100(Pinger.java:28)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:108)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:104)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, email me danikula@gmail.com or create issue here https://github.com/danikula/AndroidVideoCache/issues
com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, email me danikula@gmail.com or create issue here https://github.com/danikula/AndroidVideoCache/issues
at com.danikula.videocache.Pinger.ping(Pinger.java:67)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:182)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:119)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:100)
at com.danikula.videocache.sample.VideoFragment.startVideo(VideoFragment.java:59)
at com.danikula.videocache.sample.VideoFragment.afterViewInjected(VideoFragment.java:44)
at com.danikula.videocache.sample.VideoFragment_.onViewChanged(VideoFragment_.java:107)
at org.androidannotations.api.view.OnViewChangedNotifier.notifyViewChanged(OnViewChangedNotifier.java:41)
at com.danikula.videocache.sample.VideoFragment_.onViewCreated(VideoFragment_.java:72)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1097)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1259)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1624)
at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:330)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:547)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1237)
at android.app.Activity.performStart(Activity.java:6268)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 71 (1 by maintainers)
hey! i had this issue in Api 29 lib version 2.7.1. The problemis the http protocol in proxy settings, this will be https for new versions of android. I fix it add new xml file for networkconfig:
<network-security-config> <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">127.0.0.1</domain> </domain-config> <base-config cleartextTrafficPermitted="true"> <trust-anchors> <certificates src="system" /> </trust-anchors> </base-config> </network-security-config >and add this configuration to application node
<application android:networkSecurityConfig="@xml/network_config" ...sorry by my poor english, enjoy! and thanks so much for library 😉
Hi. Using AndroidVideoCache version 2.7.0 I saw the log below, so here I am, reporting as asked 😃 Hope it helps somehow.
I was testing using AndroidVideoCache inside recyclerview rows to pre-load audio and video. Scrolling between a lot of items very fast, around list position 650 the log stack traces appeared:
(…)
(…)
i have solved by adding
android:usesCleartextTraffic="true"to<application>in ManifestThis is becoming a recurring issue in our end. Anyone has leads on this issue? @danikula Do you have plans on fixing or probably investigating this issue? Or anyone knows any alternative library to use? Thanks.
In my case the issue is the target version you have chosen for your android application. if it’s android 9.0 or higher it will not work with legacy applications.
I simply resolved it by adding
<uses-library android:name="org.apache.http.legacy" android:required="false" />under my<application>inAndroidManifest.xmlBecause server try to make an
httprequest instead of anhttpsrequest.i have tried three solutions, but no one worked. 1.add
android:usesCleartextTraffic="true"intoAndroidManifest.xmlapplication; 2.addandroid:networkSecurityConfig="@xml/network_security_config"intoAndroidManifest.xmlapplication; 3.add<uses-library android:name="org.apache.http.legacy" android:required="false" />intoAndroidManifest.xmlapplication;I have this error in Android 6 Lg Phone, with Android Pie works with this line android:usesCleartextTraffic=“true”
Was getting this issue using the Android emulator. Turns out it was because Android P by default blocks cleartext support for HTTP calls, so if you’re using 127.0.0.1 or something like that for your proxy, it’ll be blocked. You can add exceptions for certain domains to get around that. Not sure if this helps anybody else.
who is MrStanaland?
I have the same issue.
Fixed using this answer: https://stackoverflow.com/a/54268640/3994630
Hi, I have got the error to in Logcat.
E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT] com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at https://github.com/danikula/AndroidVideoCache/issues/134. Default proxies are: [DIRECT]. Version: 2.7.1 at com.danikula.videocache.Pinger.ping(Pinger.java:73) at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:185) at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:122) at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:103)As requested to submit, I’m submitting… Details: Using: 2.7.1 of library Playing mp3 audio from S3 server with ExoPlayer, I’m passing proxy url to ExoPlayer. AndroidX Project
这个是不是在android 9.0后爆出的问题