danikula / AndroidVideoCache

Cache support for any video player with help of single line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error pinging server

danikula opened this issue · comments

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)

Since #28 fixed by this commit it should be fixed too.

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:

08-01 23:37:33.905 16591-16591 W/Pinger: Error pinging server (attempt: 0, timeout: 70). 
08-01 23:37:34.046 16591-16591 W/Pinger: Error pinging server (attempt: 1, timeout: 140). 
08-01 23:37:34.326 16591-16591 W/Pinger: Error pinging server (attempt: 2, timeout: 280). 
08-01 23:37:34.335 16591-16591 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.0
                                                              at com.danikula.videocache.Pinger.ping(Pinger.java:73)
                                                              at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
                                                              at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
                                                              at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
                                                              at com.myapp.app.controller.AssetController.streamAsset(AssetController.java:117)
                                                              at com.myapp.app.ui.main.feed.cell.AppVideoCell.bind(AppVideoCell.java:38)
                                                              at com.myapp.app.ui.main.feed.AppListAdapter.onBindViewHolder(AppListAdapter.java:97)
                                                              at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6356)
                                                              at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6389)
                                                              at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5335)
                                                              at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5598)
                                                              at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:282)
                                                              at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:336)
                                                              at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:349)
                                                              at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:356)
                                                              at android.support.v7.widget.GapWorker.run(GapWorker.java:387)
                                                              at android.os.Handler.handleCallback(Handler.java:751)
                                                              at android.os.Handler.dispatchMessage(Handler.java:95)
                                                              at android.os.Looper.loop(Looper.java:154)
                                                              at android.app.ActivityThread.main(ActivityThread.java:6126)
                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

(...)

08-01 23:37:34.543 16591-16591 W/Pinger: Error pinging server (attempt: 0, timeout: 70). 
08-01 23:37:34.685 16591-16591 W/Pinger: Error pinging server (attempt: 1, timeout: 140). 
08-01 23:37:34.966 16591-16591 W/Pinger: Error pinging server (attempt: 2, timeout: 280). 
08-01 23:37:34.969 16591-16591 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.0
                                                              at com.danikula.videocache.Pinger.ping(Pinger.java:73)
                                                              at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
                                                              at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
                                                              at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
                                                              at com.myapp.app.controller.AssetController.streamAsset(AssetController.java:117)
                                                              at com.myapp.app.ui.main.feed.cell.AppVideoCell.bind(AppVideoCell.java:38)
                                                              at com.myapp.app.ui.main.feed.AppListAdapter.onBindViewHolder(AppListAdapter.java:97)
                                                              at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6356)
                                                              at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6389)
                                                              at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5335)
                                                              at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5598)
                                                              at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5440)
                                                              at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5436)
                                                              at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2224)
                                                              at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1551)
                                                              at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1511)
                                                              at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1325)
                                                              at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1061)
                                                              at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4726)
                                                              at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
                                                              at android.view.Choreographer.doCallbacks(Choreographer.java:686)
                                                              at android.view.Choreographer.doFrame(Choreographer.java:618)
                                                              at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
                                                              at android.os.Handler.handleCallback(Handler.java:751)
                                                              at android.os.Handler.dispatchMessage(Handler.java:95)
                                                              at android.os.Looper.loop(Looper.java:154)
                                                              at android.app.ActivityThread.main(ActivityThread.java:6126)
                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

(...)

08-01 23:37:37.535 16591-20734 E/ProxyCache: ProxyCache error
                                                              com.danikula.videocache.ProxyCacheException: Error opening connection for http://api.myapp.com/asset/123 with offset 72932. Version: 2.7.0
                                                                  at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
                                                                  at com.danikula.videocache.ProxyCache.readSource(ProxyCache.java:123)
                                                                  at com.danikula.videocache.ProxyCache.access$100(ProxyCache.java:19)
                                                                  at com.danikula.videocache.ProxyCache$SourceReaderRunnable.run(ProxyCache.java:187)
                                                                  at java.lang.Thread.run(Thread.java:761)
                                                               Caused by: java.io.FileNotFoundException: http://api.myapp.com/asset/123
                                                                  at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:250)
                                                                  at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:70)
                                                                  at com.danikula.videocache.ProxyCache.readSource(ProxyCache.java:123) 
                                                                  at com.danikula.videocache.ProxyCache.access$100(ProxyCache.java:19) 
                                                                  at com.danikula.videocache.ProxyCache$SourceReaderRunnable.run(ProxyCache.java:187) 
                                                                  at java.lang.Thread.run(Thread.java:761) 
08-01 23:37:37.537 16591-17446 E/HttpProxyCacheServer: HttpProxyCacheServer error
                                                                        com.danikula.videocache.ProxyCacheException: Error processing request. Version: 2.7.0
                                                                            at com.danikula.videocache.HttpProxyCacheServer.processSocket(HttpProxyCacheServer.java:241)
                                                                            at com.danikula.videocache.HttpProxyCacheServer.access$200(HttpProxyCacheServer.java:52)
                                                                            at com.danikula.videocache.HttpProxyCacheServer$SocketProcessorRunnable.run(HttpProxyCacheServer.java:338)
                                                                            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
                                                                            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                                                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                                                                            at java.lang.Thread.run(Thread.java:761)
                                                                         Caused by: com.danikula.videocache.ProxyCacheException: Error reading source 1 times. Version: 2.7.0
                                                                            at com.danikula.videocache.ProxyCache.checkReadSourceErrorsCount(ProxyCache.java:59)
                                                                            at com.danikula.videocache.ProxyCache.read(ProxyCache.java:45)
                                                                            at com.danikula.videocache.HttpProxyCache.responseWithCache(HttpProxyCache.java:79)
                                                                            at com.danikula.videocache.HttpProxyCache.processRequest(HttpProxyCache.java:45)
                                                                            at com.danikula.videocache.HttpProxyCacheServerClients.processRequest(HttpProxyCacheServerClients.java:42)
                                                                            at com.danikula.videocache.HttpProxyCacheServer.processSocket(HttpProxyCacheServer.java:234)
                                                                            at com.danikula.videocache.HttpProxyCacheServer.access$200(HttpProxyCacheServer.java:52) 
                                                                            at com.danikula.videocache.HttpProxyCacheServer$SocketProcessorRunnable.run(HttpProxyCacheServer.java:338) 
                                                                            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428) 
                                                                            at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
                                                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
                                                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
                                                                            at java.lang.Thread.run(Thread.java:761) 

Have a some problem as @ricardorover

commented

E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #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 #134. Default proxies are: [DIRECT@]. Version: 2.7.0
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
at com.haier.cellarette.activity.VideoModuleActivity.startVideo(VideoModuleActivity.java:445)
at com.haier.cellarette.activity.VideoModuleActivity.showContent(VideoModuleActivity.java:353)
at com.haier.wine_consult.presenter.ConsultPresenter$5.onNext(ConsultPresenter.java:136)
at com.haier.wine_consult.presenter.ConsultPresenter$5.onNext(ConsultPresenter.java:121)
at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:139)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:215)
at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:107)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5280)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758)

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.0
                                                                 at com.danikula.videocache.Pinger.ping(Pinger.java:73)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
                                                                 ...

after many days of frustration I managed to find something: NanoHttpd/nanohttpd#270 (comment),
as MrStanaland said, Mint is causing this, at least in my case, now it works for me 👍

Mint.disableNetworkMonitoring();
Mint.initAndStartSession(context, BuildConfig.MINT);

com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [HTTP @ Version: 2.7.0
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
at com.goodchef.liking.module.paly.VideoPlayActivity.onCreate(VideoPlayActivity.java:146)
at android.app.Activity.performCreate(Activity.java:6910)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
at cn.jiguang.a.a.d.a.a.d.callActivityOnCreate(Unknown Source)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2746)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6577)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)

When I loaded the local video, there was' Error pinging server (attempt: 2, timeout: 280) 'and this Error

Default proxies are: [DIRECT]
com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]. Version: 2.7.0
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
at com.danikula.videocache.sample.VideoFragment.setupPlayer(VideoFragment.java:80)
at com.danikula.videocache.sample.VideoFragment.afterViewInjected(VideoFragment.java:63)
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:1270)
at android.app.Activity.performStart(Activity.java:6689)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2622)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)

getting this issue

Hello,I using this library,this but I rest on video list pager a long time, again scroll list,they throw the error:

`E/Pinger: Error reading ping response
com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:58762/ping with offset 0. Version: 2.7.0
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)
at com.danikula.videocache.Pinger.access$100(Pinger.java:33)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:776)
Caused by: java.io.FileNotFoundException: http://127.0.0.1:58762/ping
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:250)
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:70)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)
at com.danikula.videocache.Pinger.access$100(Pinger.java:33)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:776)

//When I look this lines,I don't think Default proxy is [HTTP @ 10.8.8.103:81] but proxy in Library is //[127.0.0.1] ,my should modify Default proxy in library?

E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [HTTP @ 10.8.8.103:81]
com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [HTTP @ 10.8.8.103:81]. Version: 2.7.0
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
at com.shuyu.gsyvideoplayer.video.base.GSYVideoView.setUp(GSYVideoView.java:381)
at com.shuyu.gsyvideoplayer.video.base.GSYVideoControlView.setUp(GSYVideoControlView.java:524)
`
I hope you can answer my question,thanks.

commented

thanks author's masterpiece . response error still occurs on my phone,even though it has "IgnoreHostProxySelector.install(PROXY_HOST, port);" in HttpProxyCacheServer constructor function.Anyone knows how to resolve it?thank you.

commented

I saw this log when I connected to Wifi which has no Connection to Internet

AND
If I close both wifi and cell data, your proxy can not provider cached res.

This problem still occurs even if wifi is connected

Reporting here, Still seeing this problem on 2.7.0.

commented

me too

too too :)

commented

me too

commented

+1

commented

+1

✋ on 2.7.1

+1

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.

09-13 16:01:11.816 17978-17978/com.xintu.microvoice W/Pinger: Error pinging server (attempt: 0, timeout: 70).
09-13 16:01:11.968 17978-17978/com.xintu.microvoice W/Pinger: Error pinging server (attempt: 1, timeout: 140).
09-13 16:01:12.250 17978-17978/com.xintu.microvoice W/Pinger: Error pinging server (attempt: 2, timeout: 280).
09-13 16:01:12.258 17978-17978/com.xintu.microvoice E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #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 #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)
at com.xintu.microvoice.service.PlayVoiceService.playMediaWhileDownload(PlayVoiceService.java:1154)
at com.xintu.microvoice.service.PlayVoiceService.controlVoice(PlayVoiceService.java:230)
at com.xintu.microvoice.service.PlayVoiceService.controlVoice(PlayVoiceService.java:186)
at com.xintu.microvoice.service.PlayVoiceService.onVoiceChanged(PlayVoiceService.java:517)
at com.xintu.microvoice.util.PlayListManager.playPreVoice(PlayListManager.java:176)
at com.xintu.microvoice.ui.activity.CarModeActivity.onClick(CarModeActivity.java:567)
at android.view.View.performClick(View.java:5215)
at android.view.View$PerformClick.run(View.java:21196)
at android.os.Handler.handleCallback(Handler.java:742)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5684)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)

10-11 20:29:16.834 19335-19335/in.togetu.video W/HttpProxyCacheDebuger: Error pinging server (attempt: 2, timeout: 280).
10-11 20:29:16.834 19335-19335/in.togetu.video E/HttpProxyCacheDebuger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT@]
10-11 20:29:17.144 19335-19335/in.togetu.video W/System.err: at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:194)
10-11 20:29:17.144 19335-19335/in.togetu.video W/System.err: at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:128)
10-11 20:29:17.144 19335-19335/in.togetu.video W/System.err: at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:109)

me too

me too

me too

Having same issues, honestly this library has tons of issues...

Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #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 #134. Default proxies are: [DIRECT]. Version: 2.7.0
at com.danikula.videocache.Pinger.ping(Pinger.java:73)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
at com.danikula.videocache.HttpProxyCacheServer.(HttpProxyCacheServer.java:82)
at com.danikula.videocache.HttpProxyCacheServer.(HttpProxyCacheServer.java:52)
at com.danikula.videocache.HttpProxyCacheServer$Builder.build(HttpProxyCacheServer.java:435)
at com.iflytek.common.cache.MediaCacheProxy.newProxy(MediaCacheProxy.kt:49)
at com.iflytek.common.cache.MediaCacheProxy.init(MediaCacheProxy.kt:21)
at com.iflytek.yyspoken.read.ReadApplication.onCreate(ReadApplication.kt:47)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5503)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1595)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6251)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)

me toooooo,version:2.7.1 , how resolve it?

This 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.

这个是不是在android 9.0后爆出的问题

这个是不是在android 9.0后爆出的问题
I also see this issue in android 8.0

Seeing this issue in our app.

01-11 08:26:39.530 14814-14935/com.airbnb.android.development E/Pinger: Error reading ping response
    com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:36586/ping with offset 0. Version: 2.7.0
        at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
        at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)
        at com.danikula.videocache.Pinger.access$100(Pinger.java:33)
        at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)
        at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted
        at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:407)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:538)
        at com.danikula.videocache.HttpUrlSource.openConnection(HttpUrlSource.java:160)
        at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:68)
        at com.danikula.videocache.Pinger.pingServer(Pinger.java:101) 
        at com.danikula.videocache.Pinger.access$100(Pinger.java:33) 
        at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123) 
        at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 
01-11 08:26:39.535 14814-14935/com.airbnb.android.development I/chatty: uid=10086(com.airbnb.android.development) pool-18-thread- identical 1 line
01-11 08:26:39.538 14814-14935/com.airbnb.android.development E/Pinger: Error reading ping response
    com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:36586/ping with offset 0. Version: 2.7.0
        at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
        at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)
        at com.danikula.videocache.Pinger.access$100(Pinger.java:33)
        at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)
        at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted
        at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:407)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:538)
        at com.danikula.videocache.HttpUrlSource.openConnection(HttpUrlSource.java:160)
        at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:68)
        at com.danikula.videocache.Pinger.pingServer(Pinger.java:101) 
        at com.danikula.videocache.Pinger.access$100(Pinger.java:33) 
        at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123) 
        at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 
01-11 08:26:39.540 14814-14908/com.airbnb.android.development 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.0
        at com.danikula.videocache.Pinger.ping(Pinger.java:73)
        at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
        at com.danikula.videocache.HttpProxyCacheServer.<init>(HttpProxyCacheServer.java:82)
        at com.danikula.videocache.HttpProxyCacheServer.<init>(HttpProxyCacheServer.java:67)

com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:38222/ping with offset 0. Version: 6.0.3

Heppened to me Version: 2.7.1

Heppened to me Version: 2.7.1 .
nokia x6 android 9.0

me to with version 2.7.1 and android 9.0

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> in AndroidManifest.xml

Because server try to make an http request instead of an https request.

i have solved by adding android:usesCleartextTraffic="true" to <application> in Manifest

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

I have this error in Android 6 Lg Phone, with Android Pie works with this line android:usesCleartextTraffic="true"

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

10/08/2019 20:31:38.113 HttpUrlSource - Open connection to http://127.0.0.1:37361/ping
10/08/2019 20:31:38.177 Pinger - Error pinging server (attempt: 0, timeout: 70).
10/08/2019 20:31:38.317 Pinger - Error pinging server (attempt: 1, timeout: 140).
10/08/2019 20:31:38.598 Pinger - Error pinging server (attempt: 2, timeout: 280).
10/08/2019 20:31:38.602 Pinger - Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #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 #134. Default proxies are: [DIRECT]. Version: 2.7.1
at com.danikula.videocache.Pinger.ping(Pinger.java:73) ~[na:0.0]
at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:185) ~[na:0.0]
at com.danikula.videocache.HttpProxyCacheServer.(HttpProxyCacheServer.java:84) ~[na:0.0]
at com.danikula.videocache.HttpProxyCacheServer.(HttpProxyCacheServer.java:54) ~[na:0.0]
at com.danikula.videocache.HttpProxyCacheServer$Builder.build(HttpProxyCacheServer.java:451) ~[na:0.0]
at com.circle38.photocircle.PCApplication.onCreate(PCApplication.java:127) ~[na:0.0]
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154) ~[na:0.0]
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6209) ~[na:0.0]
at android.app.ActivityThread.access$1200(ActivityThread.java:236) ~[na:0.0]
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1784) ~[na:0.0]
at android.os.Handler.dispatchMessage(Handler.java:106) ~[na:0.0]
at android.os.Looper.loop(Looper.java:214) ~[na:0.0]
at android.app.ActivityThread.main(ActivityThread.java:7037) ~[na:0.0]
at java.lang.reflect.Method.invoke(Native Method) ~[na:0.0]
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) ~[na:0.0]
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965) ~[na:0.0]
10/08/2019 20:31:38.602 HttpProxyCacheServer - Proxy cache server started. Is it alive? false

I have the same issue.

Same issue, its because of using http url for ping instead of https.

can we change the ping to https? Since you are pinging localhost should be possible?

E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #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 #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)
at com.vilynx.sdk.mappers.VilynxResponseDataMapper$Companion.mapResponse(VilynxResponseDataMapper.kt:38)
at com.vilynx.sdk.repository.GetHashesRemoteDataSource$getHashes$1.onResponse(GetHashesRemoteDataSource.kt:44)
at com.google.firebase.perf.network.zzf.onResponse(com.google.firebase:firebase-perf@@18.0.1:22)
at com.newrelic.agent.android.instrumentation.okhttp3.CallbackExtension.onResponse(CallbackExtension.java:41)
at com.google.firebase.perf.network.zzf.onResponse(com.google.firebase:firebase-perf@@18.0.1:22)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:203)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)

It said to report this message so here I am reporting

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> in AndroidManifest.xml

Because server try to make an http request instead of an https request.

this helps for me too, thanks)

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 ;)

commented

i have tried three solutions, but no one worked.
1.add android:usesCleartextTraffic="true" into AndroidManifest.xml application;
2.add android:networkSecurityConfig="@xml/network_security_config" into AndroidManifest.xml application;
3.add <uses-library android:name="org.apache.http.legacy" android:required="false" /> into AndroidManifest.xml application;

commented

One case, when you start proxy server thread and never interrupt it, and then, if the proxy server count more than a uncertain threshold, it may cause occur ping server failed.
The correct way to do this is, when you get out of this proxy server, you need shutdown it.

:_Error reading ping response: [ (Pinger.java:104)#PingServer ] com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:37213/ping with offset 0. Version: 2.7.1

please help me getting above error

2020-11-16 11:31:48.744 5837-5837/com.invid.user E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #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 #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)
at com.invid.user.Fragments.PlayerFragment.getMediaSource(PlayerFragment.java:228)
at com.invid.user.Fragments.PlayerFragment.playNextVideo(PlayerFragment.java:188)
at com.invid.user.Fragments.PlayerFragment$3.onPlayerStateChanged(PlayerFragment.java:298)
at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate.lambda$run$4$ExoPlayerImpl$PlaybackInfoUpdate(ExoPlayerImpl.java:843)
at com.google.android.exoplayer2.-$$Lambda$ExoPlayerImpl$PlaybackInfoUpdate$sJrY7lA_vUJy5MdfV-ndTSxVTXI.invokeListener(Unknown Source:2)
at com.google.android.exoplayer2.BasePlayer$ListenerHolder.invoke(BasePlayer.java:172)
at com.google.android.exoplayer2.ExoPlayerImpl.invokeAll(ExoPlayerImpl.java:860)
at com.google.android.exoplayer2.ExoPlayerImpl.access$000(ExoPlayerImpl.java:43)
at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate.run(ExoPlayerImpl.java:841)
at com.google.android.exoplayer2.ExoPlayerImpl.notifyListeners(ExoPlayerImpl.java:754)
at com.google.android.exoplayer2.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:728)
at com.google.android.exoplayer2.ExoPlayerImpl.handlePlaybackInfo(ExoPlayerImpl.java:673)
at com.google.android.exoplayer2.ExoPlayerImpl.handleEvent(ExoPlayerImpl.java:623)
at com.google.android.exoplayer2.ExoPlayerImpl$1.handleMessage(ExoPlayerImpl.java:127)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7562)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

i have tried all solutions, but no one worked.

kula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:34413/ping with offset 0. Version: 2.7.1
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:85)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)
at com.danikula.videocache.Pinger.access$100(Pinger.java:33)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:124)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:480)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:429)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:560)
at com.danikula.videocache.HttpUrlSource.openConnection(HttpUrlSource.java:171)
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:78)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101) 
at com.danikula.videocache.Pinger.access$100(Pinger.java:33) 
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123) 
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:919) 

i have tried three solutions, but no one worked.
1.add android:usesCleartextTraffic="true" into AndroidManifest.xml application;
2.add android:networkSecurityConfig="@xml/network_security_config" into AndroidManifest.xml application;
3.add <uses-library android:name="org.apache.http.legacy" android:required="false" /> into AndroidManifest.xml application;

it worked for me, thank you.

我同样遇到了这个问题,使用viewpager2+fragment ,在fragment中展示Jzvd player。

E/MediaMetadataRetrieverJNI: getFrameAtTime: videoFrame is a NULL pointer 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] 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

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.0
                                                                 at com.danikula.videocache.Pinger.ping(Pinger.java:73)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:183)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:120)
                                                                 at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:101)
                                                                 ...

after many days of frustration I managed to find something: NanoHttpd/nanohttpd#270 (comment),
as MrStanaland said, Mint is causing this, at least in my case, now it works for me 👍

Mint.disableNetworkMonitoring();
Mint.initAndStartSession(context, BuildConfig.MINT);

who is MrStanaland?

commented

Same with @nuborisar, and the solution works for the following case:

Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted

Check your android:networkSecurityConfig file, and add

<domain-config cleartextTrafficPermitted="true">
    <domain includeSubdomains="true">127.0.0.1</domain>
</domain-config>

runOnUiThread(Runnable {
this.netPath = netPath
// var videoUrl = Const.PicBaseUrlConst.VID_BASE_URL.plus(netPath)
var videoUrl = "http://122.51.230.43:8081/e98d5c1b754b2fcb7941232135504a46/wx_camera_1584678750453.mp4"
Log.e("JavascriptInterface", "videoUrl:" + videoUrl)

videoplayer.setUp(videoUrl,"dsa", Jzvd.SCREEN_NORMAL)//videoplayer
Glide.with(videoplayer).load(videoUrl).into(videoplayer.posterImageView)

Log.e("JavascriptInterface", "videoUrl:" + videoUrl)

// viewModel.uploadCover()
// viewModel.postVideoArticle(netPath,)
video_capture.visibility = View.GONE
})

}

Use runOnUiThread can fixed it

i have see this: when i use it:

  1. Android Studio & Platform:
Android Studio 4.1.1
Build #AI-201.8743.12.41.6953283, built on November 5, 2020
Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.16
  1. Android build.gradle config:
  minSdkVersion 21
  targetSdkVersion 30

  kotlinOptions { jvmTarget = '1.8' }
  1. Phone: XIAOMI K30 (Android11, MIUI12)

  2. The way i use it:

// i had use "ktor" to make requests to local  proxy server.
CoroutineScope(Dispatchers.IO).launch {
  ...
  var client: HttpClient? = null
  try {
      ...
     client = HttpClient(OkHttp) ...
     val statement = client.get<HttpStatement>(httpProxyCacheServer.getProxyUrl(rawUrl)) // this is (PreloadStatement.kt:53)
     ...
  }
}
  1. other info:
    i had not implementation this library derectly but use third-party library:
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v8.1.3-jitpack'
  1. i've clone this project newest and compare with that:
    just some thing different:

截屏2021-04-25 下午6 18 06

  1. i try to exclude third-party lib and use this:
    implementation("com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:$GSY_PLAYER_VERSION") {
        exclude group: 'com.github.CarGuo.GSYVideoPlayer', module: 'gsyVideoPlayer-proxy_cache'
    }
    implementation "com.danikula:videocache:2.7.1"

but not working, and crash as if because not support https.

  1. error log:
2021-04-25 17:40:37.311 32413-32579/com.mycompany.demo W/HttpProxyCacheDebuger: Error pinging server (attempt: 2, timeout: 280). 
2021-04-25 17:40:37.311 32413-32574/com.mycompany.demo W/HttpProxyCacheDebuger: Error pinging server (attempt: 2, timeout: 280). 
2021-04-25 17:40:37.312 32413-32579/com.mycompany.demo E/HttpProxyCacheDebuger: 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]
2021-04-25 17:40:37.312 32413-32574/com.mycompany.demo E/HttpProxyCacheDebuger: 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]
2021-04-25 17:40:37.312 32413-32574/com.mycompany.demo W/System.err: 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: 8.1.2
2021-04-25 17:40:37.312 32413-32574/com.mycompany.demo W/System.err:     at com.danikula.videocache.Pinger.ping(Pinger.java:71)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:184)
    
    [          1619343637.313 32413:32510 W/Failed to close socket on proxy side: {}. It seems client have already closed connectioshutdown failed: ENOTCONN (Transport endpoint is not connected)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:121)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:102)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at com.mycompany.demo.ui.video.manager.PreloadStatement$start$1.invokeSuspend(PreloadStatement.kt:53)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
2021-04-25 17:40:37.313 32413-32574/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2021-04-25 17:40:37.313 32413-32579/com.mycompany.demo W/System.err: 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: 8.1.2
2021-04-25 17:40:37.313 32413-32579/com.mycompany.demo W/System.err:     at com.danikula.videocache.Pinger.ping(Pinger.java:71)
2021-04-25 17:40:37.313 32413-32579/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:184)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:121)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:102)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at com.mycompany.demo.ui.video.manager.PreloadStatement$start$1.invokeSuspend(PreloadStatement.kt:53)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
2021-04-25 17:40:37.314 32413-32579/com.mycompany.demo W/System.err:     at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
2021-04-25 17:40:37.316 32413-32510/com.mycompany.demo I/HttpProxyCacheDebuger: Opened connections: 7
2021-04-25 17:40:37.339 32413-32510/com.mycompany.demo E/HttpProxyCacheDebuger: ****** injectCustomHeaders ****** :0

E/HttpProxyCacheServer: HttpProxyCacheServer error
com.danikula.videocache.ProxyCacheException: Error during waiting connection. Version: 2.7.1
at com.danikula.videocache.HttpProxyCacheServer.waitForRequest(HttpProxyCacheServer.java:223)
at com.danikula.videocache.HttpProxyCacheServer.access$100(HttpProxyCacheServer.java:54)
at com.danikula.videocache.HttpProxyCacheServer$WaitRequestsRunnable.run(HttpProxyCacheServer.java:326)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.net.SocketException: Socket closed
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:389)
at java.net.ServerSocket.implAccept(ServerSocket.java:531)
at java.net.ServerSocket.accept(ServerSocket.java:499)
at com.danikula.videocache.HttpProxyCacheServer.waitForRequest(HttpProxyCacheServer.java:218)
at com.danikula.videocache.HttpProxyCacheServer.access$100(HttpProxyCacheServer.java:54) 
at com.danikula.videocache.HttpProxyCacheServer$WaitRequestsRunnable.run(HttpProxyCacheServer.java:326) 
at java.lang.Thread.run(Thread.java:761) 

commented

2022-03-09 09:16:55.536 10193-10193/com.yihua.hugou W/System.err: com.danikula.videocache.ProxyCacheException: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #134. Default proxies are: [DIRECT]. Version: 7.1.5
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at com.danikula.videocache.Pinger.ping(Pinger.java:71)
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at com.danikula.videocache.HttpProxyCacheServer.isAlive(HttpProxyCacheServer.java:181)
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:118)
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at com.danikula.videocache.HttpProxyCacheServer.getProxyUrl(HttpProxyCacheServer.java:99)
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at com.shuyu.gsyvideoplayer.cache.ProxyCacheManager.doCacheLogic(ProxyCacheManager.java:75)
2022-03-09 09:16:55.537 10193-10193/com.yihua.hugou W/System.err: at tv.danmaku.ijk.media.exo2.Exo2PlayerManager.initVideoPlayer(Exo2PlayerManager.java:62)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at com.shuyu.gsyvideoplayer.GSYVideoBaseManager.initVideo(GSYVideoBaseManager.java:612)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at com.shuyu.gsyvideoplayer.GSYVideoBaseManager.access$000(GSYVideoBaseManager.java:38)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at com.shuyu.gsyvideoplayer.GSYVideoBaseManager$MediaHandler.handleMessage(GSYVideoBaseManager.java:572)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at android.os.Handler.dispatchMessage(Handler.java:110)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at android.os.Looper.loop(Looper.java:219)
2022-03-09 09:16:55.538 10193-10193/com.yihua.hugou W/System.err: at android.app.ActivityThread.main(ActivityThread.java:8668)
2022-03-09 09:16:55.539 10193-10193/com.yihua.hugou W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2022-03-09 09:16:55.539 10193-10193/com.yihua.hugou W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
2022-03-09 09:16:55.539 10193-10193/com.yihua.hugou W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)

2022-06-30 12:42:34.686 27076-27767/myapp.debug E/Pinger: Error reading ping response
com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:37983/ping with offset 0. Version: 2.7.1
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:85)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)
at com.danikula.videocache.Pinger.access$100(Pinger.java:33)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:124)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
at com.danikula.videocache.HttpUrlSource.openConnection(HttpUrlSource.java:171)
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:78)
at com.danikula.videocache.Pinger.pingServer(Pinger.java:101) 
at com.danikula.videocache.Pinger.access$100(Pinger.java:33) 
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123) 
at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:919) 
2022-06-30 12:42:34.688 27076-27398/myapp.debug E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #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 #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)

E Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #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 #134. Default proxies are: [DIRECT]. Version: 2.7.1
at com.danikula.videocache.Pinger.ping(Unknown Source:135)
at com.danikula.videocache.HttpProxyCacheServer.isAlive(Unknown Source:5)
at com.danikula.videocache.HttpProxyCacheServer.(Unknown Source:101)
at com.danikula.videocache.HttpProxyCacheServer.(Unknown Source:0)
at com.danikula.videocache.HttpProxyCacheServer$Builder.build(Unknown Source:7)

commented

我同样遇到了这个问题,使用viewpager2+fragment ,在fragment中展示Jzvd player。

E/MediaMetadataRetrieverJNI: getFrameAtTime: videoFrame is a NULL pointer 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] 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

有找到解决办法么,我和你使用场景一样

commented

Is there a solution?

2022-06-30 12:42:34.686 27076-27767/myapp.debug E/Pinger: Error reading ping response com.danikula.videocache.ProxyCacheException: Error opening connection for http://127.0.0.1:37983/ping with offset 0. Version: 2.7.1 at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:85) at com.danikula.videocache.Pinger.pingServer(Pinger.java:101) at com.danikula.videocache.Pinger.access$100(Pinger.java:33) at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123) at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919) Caused by: java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:124) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542) at com.danikula.videocache.HttpUrlSource.openConnection(HttpUrlSource.java:171) at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:78) at com.danikula.videocache.Pinger.pingServer(Pinger.java:101)  at com.danikula.videocache.Pinger.access$100(Pinger.java:33)  at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:123)  at com.danikula.videocache.Pinger$PingCallable.call(Pinger.java:119)  at java.util.concurrent.FutureTask.run(FutureTask.java:266)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:919)  2022-06-30 12:42:34.688 27076-27398/myapp.debug E/Pinger: Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #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 #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)

Adding networkSecurityConfig to manifest has solved this problem for me. See here: https://stackoverflow.com/a/54268640/4191562

Error pinging server (attempts: 3, max timeout: 280). If you see this message, please, report at #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 #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)

Finally following solution worked for me :)
add following in a xml file network_security_config inside res/xml dir
<network-security-config> <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">127.0.0.1</domain> </domain-config> <base-config cleartextTrafficPermitted="false"> <trust-anchors> <certificates src="system" /> </trust-anchors> </base-config> </network-security-config>

add following lines in Manifest.xml file inside application tag and outside activity
android:networkSecurityConfig="@xml/network_security_config"