Android - FRESCO 未加载 JPG 图像
Android - FRESCO not loading JPG Images
我正在尝试使用 Fresco 库加载图像,但我遇到了一个奇怪的问题。
正在加载 png 图片,但我加载的是 jpg 图片
我使用的 fresco 版本是 2.0.0,我尝试了所有使缓存无效、更改 fresco 版本、清除数据、重建项目的方法。但对我来说没有任何意义。
不工作
fresco_img.setImageURI("http://static.tvmaze.com/uploads/images/medium_portrait/213/533527.jpg")
工作
fresco_img.setImageURI("https://raw.githubusercontent.com/facebook/fresco/master/docs/static/logo.png")
这就是我初始化 Fresco 的方式
// Initialize Fresco
Fresco.initialize(this)
您可以看到以下所有日志:
2019-11-21 12:11:29.448 28592-28592/? I/com.koa.tvmaze: Late-enabling -Xcheck:jni
2019-11-21 12:11:30.179 28592-28592/com.koa.tvmaze I/Perf: Connecting to perf service.
2019-11-21 12:11:30.195 28592-28592/com.koa.tvmaze I/MultiDex: VM with version 2.1.0 has multidex support
2019-11-21 12:11:30.195 28592-28592/com.koa.tvmaze I/MultiDex: Installing application
2019-11-21 12:11:30.195 28592-28592/com.koa.tvmaze I/MultiDex: VM has multidex support, MultiDex support library is disabled.
2019-11-21 12:11:30.195 28592-28592/com.koa.tvmaze I/MultiDex: Installing application
2019-11-21 12:11:30.195 28592-28592/com.koa.tvmaze I/MultiDex: VM has multidex support, MultiDex support library is disabled.
2019-11-21 12:11:30.222 28592-28592/com.koa.tvmaze D/SoLoader: init start
2019-11-21 12:11:30.222 28592-28592/com.koa.tvmaze D/SoLoader: adding system library source: /vendor/lib
2019-11-21 12:11:30.223 28592-28592/com.koa.tvmaze D/SoLoader: adding system library source: /system/lib
2019-11-21 12:11:30.224 28592-28592/com.koa.tvmaze D/SoLoader: adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.koa.tvmaze-tSzb6qZR88CUMaXdWVOFTg==/lib/arm64 flags = 0]
2019-11-21 12:11:30.228 28592-28592/com.koa.tvmaze D/SoLoader: adding backup source from : com.facebook.soloader.ApkSoSource[root = /data/data/com.koa.tvmaze/lib-main flags = 1]
2019-11-21 12:11:30.228 28592-28592/com.koa.tvmaze D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/lib flags = 2]
2019-11-21 12:11:30.228 28592-28592/com.koa.tvmaze D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /vendor/lib flags = 2]
2019-11-21 12:11:30.228 28592-28592/com.koa.tvmaze D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.koa.tvmaze-tSzb6qZR88CUMaXdWVOFTg==/lib/arm64 flags = 0]
2019-11-21 12:11:30.228 28592-28592/com.koa.tvmaze D/SoLoader: Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/com.koa.tvmaze/lib-main flags = 1]
2019-11-21 12:11:30.230 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: locked dso store /data/user/0/com.koa.tvmaze/lib-main
2019-11-21 12:11:30.233 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: deps mismatch on deps store: regenerating
2019-11-21 12:11:30.233 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: so store dirty: regenerating
2019-11-21 12:11:30.332 28592-28592/com.koa.tvmaze D/ApkSoSource: not allowing consideration of lib/arm64-v8a/libimagepipeline.so: deferring to libdir
2019-11-21 12:11:30.332 28592-28592/com.koa.tvmaze D/ApkSoSource: not allowing consideration of lib/arm64-v8a/libnative-filters.so: deferring to libdir
2019-11-21 12:11:30.332 28592-28592/com.koa.tvmaze D/ApkSoSource: not allowing consideration of lib/arm64-v8a/libnative-imagetranscoder.so: deferring to libdir
2019-11-21 12:11:30.333 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: regenerating DSO store com.facebook.soloader.ApkSoSource
2019-11-21 12:11:30.334 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: Finished regenerating DSO store com.facebook.soloader.ApkSoSource
2019-11-21 12:11:30.334 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: starting syncer worker
2019-11-21 12:11:30.347 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.koa.tvmaze/lib-main (from syncer thread)
2019-11-21 12:11:30.347 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: not releasing dso store lock for /data/user/0/com.koa.tvmaze/lib-main (syncer thread started)
2019-11-21 12:11:30.347 28592-28592/com.koa.tvmaze D/SoLoader: init finish: 4 SO sources prepared
2019-11-21 12:11:30.347 28592-28592/com.koa.tvmaze D/SoLoader: init exiting
2019-11-21 12:11:30.473 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
2019-11-21 12:11:30.473 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
2019-11-21 12:11:30.473 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
2019-11-21 12:11:30.473 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
2019-11-21 12:11:30.473 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
2019-11-21 12:11:30.490 28592-28592/com.koa.tvmaze I/DecorView: It non-support bigbang
2019-11-21 12:11:30.494 28592-28592/com.koa.tvmaze I/PhoneWindow: isNeedChangeNaviBarColor taskInfo: [android.app.ActivityManager$RunningTaskInfo@2114b67] size: 1
2019-11-21 12:11:30.495 28592-28592/com.koa.tvmaze I/PhoneWindow: isAPPNeedChange pkgName: com.koa.tvmaze needKeep: false
2019-11-21 12:11:30.495 28592-28592/com.koa.tvmaze I/PhoneWindow: isNeedChangeNaviBarColor false
2019-11-21 12:11:30.495 28592-28592/com.koa.tvmaze I/PhoneWindow: generateLayout mNavigationBarColor: ff000000
2019-11-21 12:11:30.496 28592-28592/com.koa.tvmaze I/PhoneWindow: generateLayout isLightNavi false, Visibility: 0
2019-11-21 12:11:30.541 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
2019-11-21 12:11:30.543 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
2019-11-21 12:11:30.616 28592-28592/com.koa.tvmaze D/OpenGLRenderer: Skia GL Pipeline
2019-11-21 12:11:30.672 28592-28625/com.koa.tvmaze I/Adreno: QUALCOMM build : a4d39a0, I6fd668c4d3
Build Date : 10/05/18
OpenGL ES Shader Compiler Version: EV031.25.03.01
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.7.2.R1.09.00.00.442.049
Remote Branch : NONE
Reconstruct Branch : NOTHING
2019-11-21 12:11:30.672 28592-28625/com.koa.tvmaze I/Adreno: Build Config : S L 6.0.7 AArch64
2019-11-21 12:11:30.676 28592-28628/com.koa.tvmaze I/DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
2019-11-21 12:11:30.680 28592-28625/com.koa.tvmaze I/Adreno: PFP: 0x005ff112, ME: 0x005ff066
2019-11-21 12:11:30.680 28592-28628/com.koa.tvmaze D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2019-11-21 12:11:30.685 28592-28625/com.koa.tvmaze I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2019-11-21 12:11:30.685 28592-28625/com.koa.tvmaze I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2019-11-21 12:11:30.686 28592-28625/com.koa.tvmaze I/OpenGLRenderer: Initialized EGL, version 1.4
2019-11-21 12:11:30.686 28592-28625/com.koa.tvmaze D/OpenGLRenderer: Swap behavior 2
URI 是 http 而不是 https,这可能是您遇到问题的原因。 中概述了一些解决方案,例如允许您的域:
创建文件res/xml/network_security_config.xml -
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">tvmaze.com</domain>
</domain-config>
</network-security-config>
我是如何调试的:当您启用 Fresco 调试 (https://frescolib.org/docs/faq.html) 时,您会发现图像出现以下错误消息:
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: time 588743228: onProducerFinishWithFailure: {requestId: 34, stage: NetworkFetchProducer, elapsedTime: 5 ms, extraMap: null, throwable: java.net.UnknownServiceException: CLEARTEXT communication to static.tvmaze.com not permitted by network security policy}
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: java.net.UnknownServiceException: CLEARTEXT communication to static.tvmaze.com not permitted by network security policy
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:147)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:200)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at java.lang.Thread.run(Thread.java:764)
我正在尝试使用 Fresco 库加载图像,但我遇到了一个奇怪的问题。
正在加载 png 图片,但我加载的是 jpg 图片 我使用的 fresco 版本是 2.0.0,我尝试了所有使缓存无效、更改 fresco 版本、清除数据、重建项目的方法。但对我来说没有任何意义。
不工作
fresco_img.setImageURI("http://static.tvmaze.com/uploads/images/medium_portrait/213/533527.jpg")
工作
fresco_img.setImageURI("https://raw.githubusercontent.com/facebook/fresco/master/docs/static/logo.png")
这就是我初始化 Fresco 的方式
// Initialize Fresco
Fresco.initialize(this)
您可以看到以下所有日志:
2019-11-21 12:11:29.448 28592-28592/? I/com.koa.tvmaze: Late-enabling -Xcheck:jni
2019-11-21 12:11:30.179 28592-28592/com.koa.tvmaze I/Perf: Connecting to perf service.
2019-11-21 12:11:30.195 28592-28592/com.koa.tvmaze I/MultiDex: VM with version 2.1.0 has multidex support
2019-11-21 12:11:30.195 28592-28592/com.koa.tvmaze I/MultiDex: Installing application
2019-11-21 12:11:30.195 28592-28592/com.koa.tvmaze I/MultiDex: VM has multidex support, MultiDex support library is disabled.
2019-11-21 12:11:30.195 28592-28592/com.koa.tvmaze I/MultiDex: Installing application
2019-11-21 12:11:30.195 28592-28592/com.koa.tvmaze I/MultiDex: VM has multidex support, MultiDex support library is disabled.
2019-11-21 12:11:30.222 28592-28592/com.koa.tvmaze D/SoLoader: init start
2019-11-21 12:11:30.222 28592-28592/com.koa.tvmaze D/SoLoader: adding system library source: /vendor/lib
2019-11-21 12:11:30.223 28592-28592/com.koa.tvmaze D/SoLoader: adding system library source: /system/lib
2019-11-21 12:11:30.224 28592-28592/com.koa.tvmaze D/SoLoader: adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.koa.tvmaze-tSzb6qZR88CUMaXdWVOFTg==/lib/arm64 flags = 0]
2019-11-21 12:11:30.228 28592-28592/com.koa.tvmaze D/SoLoader: adding backup source from : com.facebook.soloader.ApkSoSource[root = /data/data/com.koa.tvmaze/lib-main flags = 1]
2019-11-21 12:11:30.228 28592-28592/com.koa.tvmaze D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/lib flags = 2]
2019-11-21 12:11:30.228 28592-28592/com.koa.tvmaze D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /vendor/lib flags = 2]
2019-11-21 12:11:30.228 28592-28592/com.koa.tvmaze D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.koa.tvmaze-tSzb6qZR88CUMaXdWVOFTg==/lib/arm64 flags = 0]
2019-11-21 12:11:30.228 28592-28592/com.koa.tvmaze D/SoLoader: Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/com.koa.tvmaze/lib-main flags = 1]
2019-11-21 12:11:30.230 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: locked dso store /data/user/0/com.koa.tvmaze/lib-main
2019-11-21 12:11:30.233 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: deps mismatch on deps store: regenerating
2019-11-21 12:11:30.233 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: so store dirty: regenerating
2019-11-21 12:11:30.332 28592-28592/com.koa.tvmaze D/ApkSoSource: not allowing consideration of lib/arm64-v8a/libimagepipeline.so: deferring to libdir
2019-11-21 12:11:30.332 28592-28592/com.koa.tvmaze D/ApkSoSource: not allowing consideration of lib/arm64-v8a/libnative-filters.so: deferring to libdir
2019-11-21 12:11:30.332 28592-28592/com.koa.tvmaze D/ApkSoSource: not allowing consideration of lib/arm64-v8a/libnative-imagetranscoder.so: deferring to libdir
2019-11-21 12:11:30.333 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: regenerating DSO store com.facebook.soloader.ApkSoSource
2019-11-21 12:11:30.334 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: Finished regenerating DSO store com.facebook.soloader.ApkSoSource
2019-11-21 12:11:30.334 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: starting syncer worker
2019-11-21 12:11:30.347 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.koa.tvmaze/lib-main (from syncer thread)
2019-11-21 12:11:30.347 28592-28592/com.koa.tvmaze V/fb-UnpackingSoSource: not releasing dso store lock for /data/user/0/com.koa.tvmaze/lib-main (syncer thread started)
2019-11-21 12:11:30.347 28592-28592/com.koa.tvmaze D/SoLoader: init finish: 4 SO sources prepared
2019-11-21 12:11:30.347 28592-28592/com.koa.tvmaze D/SoLoader: init exiting
2019-11-21 12:11:30.473 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
2019-11-21 12:11:30.473 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
2019-11-21 12:11:30.473 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
2019-11-21 12:11:30.473 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
2019-11-21 12:11:30.473 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
2019-11-21 12:11:30.490 28592-28592/com.koa.tvmaze I/DecorView: It non-support bigbang
2019-11-21 12:11:30.494 28592-28592/com.koa.tvmaze I/PhoneWindow: isNeedChangeNaviBarColor taskInfo: [android.app.ActivityManager$RunningTaskInfo@2114b67] size: 1
2019-11-21 12:11:30.495 28592-28592/com.koa.tvmaze I/PhoneWindow: isAPPNeedChange pkgName: com.koa.tvmaze needKeep: false
2019-11-21 12:11:30.495 28592-28592/com.koa.tvmaze I/PhoneWindow: isNeedChangeNaviBarColor false
2019-11-21 12:11:30.495 28592-28592/com.koa.tvmaze I/PhoneWindow: generateLayout mNavigationBarColor: ff000000
2019-11-21 12:11:30.496 28592-28592/com.koa.tvmaze I/PhoneWindow: generateLayout isLightNavi false, Visibility: 0
2019-11-21 12:11:30.541 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
2019-11-21 12:11:30.543 28592-28592/com.koa.tvmaze W/com.koa.tvmaze: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
2019-11-21 12:11:30.616 28592-28592/com.koa.tvmaze D/OpenGLRenderer: Skia GL Pipeline
2019-11-21 12:11:30.672 28592-28625/com.koa.tvmaze I/Adreno: QUALCOMM build : a4d39a0, I6fd668c4d3
Build Date : 10/05/18
OpenGL ES Shader Compiler Version: EV031.25.03.01
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.7.2.R1.09.00.00.442.049
Remote Branch : NONE
Reconstruct Branch : NOTHING
2019-11-21 12:11:30.672 28592-28625/com.koa.tvmaze I/Adreno: Build Config : S L 6.0.7 AArch64
2019-11-21 12:11:30.676 28592-28628/com.koa.tvmaze I/DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
2019-11-21 12:11:30.680 28592-28625/com.koa.tvmaze I/Adreno: PFP: 0x005ff112, ME: 0x005ff066
2019-11-21 12:11:30.680 28592-28628/com.koa.tvmaze D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2019-11-21 12:11:30.685 28592-28625/com.koa.tvmaze I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2019-11-21 12:11:30.685 28592-28625/com.koa.tvmaze I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2019-11-21 12:11:30.686 28592-28625/com.koa.tvmaze I/OpenGLRenderer: Initialized EGL, version 1.4
2019-11-21 12:11:30.686 28592-28625/com.koa.tvmaze D/OpenGLRenderer: Swap behavior 2
URI 是 http 而不是 https,这可能是您遇到问题的原因。
创建文件res/xml/network_security_config.xml -
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">tvmaze.com</domain>
</domain-config>
</network-security-config>
我是如何调试的:当您启用 Fresco 调试 (https://frescolib.org/docs/faq.html) 时,您会发现图像出现以下错误消息:
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: time 588743228: onProducerFinishWithFailure: {requestId: 34, stage: NetworkFetchProducer, elapsedTime: 5 ms, extraMap: null, throwable: java.net.UnknownServiceException: CLEARTEXT communication to static.tvmaze.com not permitted by network security policy}
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: java.net.UnknownServiceException: CLEARTEXT communication to static.tvmaze.com not permitted by network security policy
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:147)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:200)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
11-21 10:28:42.038 24149 24225 W unknown:RequestLoggingListener: at java.lang.Thread.run(Thread.java:764)