Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coil加载错误 #439

Open
5 tasks done
xiaojigugu opened this issue Mar 15, 2023 · 2 comments
Open
5 tasks done

Coil加载错误 #439

xiaojigugu opened this issue Mar 15, 2023 · 2 comments

Comments

@xiaojigugu
Copy link

Environment

  • Autosize Version: 1.2.1
  • Target Android Version: Android 11
  • Device Model: 模拟器
  • Device Resolution: 1080px * 1920px
  • Design Size On AndroidManifest: 360dp * 640dp

按常见问题里所述,复写了如下代码,导致Coil加载图片直接走error方法

Related Code:

      override fun getResources(): Resources {
        val resources = super.getResources()
        AutoSizeCompat.autoConvertDensityOfGlobal(resources);
        return resources
    }

Others:

@LiuFreedom
Copy link

出现同样的问题,在coil的onerror里报错“ Not in applications main thread”,把图片加载放到主线程也无法解决

@JessYanCoding
Copy link
Owner

AutoSizeCompat.autoConvertDensityOfGlobal(resources); 是这段代码必须放在主线程

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants