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

插件化后Glide无法获取本地资源文件 #593

Open
xypeng12345 opened this issue Sep 28, 2018 · 2 comments
Open

插件化后Glide无法获取本地资源文件 #593

xypeng12345 opened this issue Sep 28, 2018 · 2 comments

Comments

@xypeng12345
Copy link

@xypeng12345 xypeng12345 commented Sep 28, 2018

  • 我已阅读并理解 贡献指南,严格遵循其约定。

错误报告

在插件化APP中使用Glide获取本地资源文件,报错无法找到。

No package found for authority: android.resource://cn.hotupdate.app.main/drawable/guide03
android.content.pm.PackageManager$NameNotFoundException: Application package cn.hotUpdate.app.main not found
主项目是cn.hotUpdate.app。,插件是.main

Glide能够正确的获取本地资源图片,或是有规避此情况的方法。

实际结果是什么?

Glide 无法获取本地资源

Small环境

Compile-time

  gradle-small plugin : 1.5.0-beta2 (maven)
            small aar : 1.5.0-beta2 (maven)
          gradle core : 4.4
       android plugin : 2.3.3
                   OS : Windows 10 10.0 (amd64)

Bundles

type name PP sdk aapt support file size
host app 27 26.0.2 27.1.1
stub app+stub 27 26.0.2 27.1.1
app app.main 0x77 27 26.0.2 27.1.1 *.main.apk 7 MB

Runtime

  Device : Samsung Nexus S
     SDK : Android 7.0
     ABI : armeabi-v7a
@xiaochenzhicheng
Copy link

@xiaochenzhicheng xiaochenzhicheng commented Dec 25, 2018

glide使用的是application context,不会用插件的context去找

@ly-android
Copy link

@ly-android ly-android commented Oct 15, 2019

InputStream is = recycleImageView.getResources().openRawResource((int) path);
//fix 插件化中使用的时候,无法找到资源
builder = Glide.with(recycleImageView.getContext()).load(inputStreamToByte(is)).asBitmap();

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.