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

Android Resource file is not included in the app build #8831

Closed
JaneySprings opened this issue Jul 19, 2022 · 3 comments
Closed

Android Resource file is not included in the app build #8831

JaneySprings opened this issue Jul 19, 2022 · 3 comments
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 s/needs-info Issue needs more info from the author s/no-recent-activity Issue has had no recent activity t/bug Something isn't working

Comments

@JaneySprings
Copy link

Description

I created a project, added an AndroidResource icon and an icon for iOS. I created a page and added an Image where I uploaded this icon. I build project and created a NuGet Package. When I use it in another project, the icon is not displayed on my page, and the error [Glide] FileNotFoundException is displayed in the log. If you use dll instead of NuGet, the icon will appear. On iOS all work perfect.

Steps to Reproduce

I create repository https://github.com/JaneySprings/AndroidResourceBug
it contains two projects:

  1. src/test - project with custom contantPage and AndroidResource icons
  2. src/tmplProj - default maui project with NuGet reference to "src/test"
    I added build scripts (for nuget and dll) in root but also added builded NuGet (TestPack.1.0.0.nupkg) and dll (/build/Android/ and /Build/iOS)

You need to add (TestPack.1.0.0.nupkg) to the local package source and run (/src/tmplProj). You will see that there is nothing on the page except label. There will be an icon on iOS. If you uncomment use of dll in csproj, then on both platforms you will see the icon.

Version with bug

6.0.408 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

All versions

Did you find any workaround?

We are developing DevExpress .NET MAUI controls and experienced the same issue in the our demo application. This issue has a High priority for us and we do not have a workaround. Thank you for your help!

Relevant log output

[Glide] Load failed for delete.png with size [132x132]
[Glide] class com.bumptech.glide.load.engine.GlideException: Failed to load resource
[Glide] There were 3 root causes:
[Glide] java.io.FileNotFoundException(/delete.png (No such file or directory))
[Glide] java.io.FileNotFoundException(open failed: ENOENT (No such file or directory))
[Glide] java.io.FileNotFoundException(open failed: ENOENT (No such file or directory))
[Glide]  call GlideException#logRootCauses(String) for more detail
[Glide]   Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, LOCAL
[Glide] There was 1 root cause:
[Glide] java.io.FileNotFoundException(/delete.png (No such file or directory))
[Glide]  call GlideException#logRootCauses(String) for more detail
[Glide]     Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
[Glide] There was 1 root cause:
[Glide] java.io.FileNotFoundException(/delete.png (No such file or directory))
[Glide]  call GlideException#logRootCauses(String) for more detail
[Glide]       Cause (1 of 1): class java.io.FileNotFoundException: /delete.png (No such file or directory)
[Glide]   Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class android.os.ParcelFileDescriptor, LOCAL
[Glide] There was 1 root cause:
[Glide] java.io.FileNotFoundException(open failed: ENOENT (No such file or directory))
[Glide]  call GlideException#logRootCauses(String) for more detail
[Glide]     Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
[Glide] There was 1 root cause:
[Glide] java.io.FileNotFoundException(open failed: ENOENT (No such file or directory))
[Glide]  call GlideException#logRootCauses(String) for more detail
[Glide]       Cause (1 of 1): class java.io.FileNotFoundException: open failed: ENOENT (No such file or directory)
[Glide]   Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class android.content.res.AssetFileDescriptor, LOCAL
[Glide] There was 1 root cause:
[Glide] java.io.FileNotFoundException(open failed: ENOENT (No such file or directory))
[Glide]  call GlideException#logRootCauses(String) for more detail
[Glide]     Cause (1 of 1): class java.io.FileNotFoundException: open failed: ENOENT (No such file or directory)
[Glide] Root cause (1 of 3)
[Glide] java.io.FileNotFoundException: /delete.png (No such file or directory)
[Glide] 	at java.io.FileInputStream.open0(Native Method)
[Glide] 	at java.io.FileInputStream.open(FileInputStream.java:200)
[Glide] 	at java.io.FileInputStream.<init>(FileInputStream.java:150)
[Glide] 	at java.io.FileInputStream.<init>(FileInputStream.java:103)
[Glide] 	at android.content.ContentResolver.openInputStream(ContentResolver.java:965)
[Glide] 	at com.bumptech.glide.load.data.StreamLocalUriFetcher.loadResourceFromUri(StreamLocalUriFetcher.java:74)
[Glide] 	at com.bumptech.glide.load.data.StreamLocalUriFetcher.loadResource(StreamLocalUriFetcher.java:50)
[Glide] 	at com.bumptech.glide.load.data.StreamLocalUriFetcher.loadResource(StreamLocalUriFetcher.java:13)
[Glide] 	at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:44)
[Glide] 	at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
[Glide] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
[Glide] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
[Glide] 	at java.lang.Thread.run(Thread.java:764)
[Glide] 	at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
[Glide] Root cause (2 of 3)
[Glide] java.io.FileNotFoundException: open failed: ENOENT (No such file or directory)
[Glide] 	at android.os.ParcelFileDescriptor.openInternal(ParcelFileDescriptor.java:313)
[Glide] 	at android.os.ParcelFileDescriptor.open(ParcelFileDescriptor.java:211)
[Glide] 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1242)
[Glide] 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1170)
[Glide] 	at com.bumptech.glide.load.data.FileDescriptorLocalUriFetcher.loadResource(FileDescriptorLocalUriFetcher.java:20)
[Glide] 	at com.bumptech.glide.load.data.FileDescriptorLocalUriFetcher.loadResource(FileDescriptorLocalUriFetcher.java:12)
[Glide] 	at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:44)
[Glide] 	at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherFailed(DecodeJob.java:412)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.onLoadFailedInternal(SourceGenerator.java:160)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator$1.onLoadFailed(SourceGenerator.java:83)
[Glide] 	at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.startNextOrFail(MultiModelLoader.java:167)
[Glide] 	at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onLoadFailed(MultiModelLoader.java:154)
[Glide] 	at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:50)
[Glide] 	at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
[Glide] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
[Glide] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
[Glide] 	at java.lang.Thread.run(Thread.java:764)
[Glide] 	at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
[Glide] Root cause (3 of 3)
[Glide] java.io.FileNotFoundException: open failed: ENOENT (No such file or directory)
[Glide] 	at android.os.ParcelFileDescriptor.openInternal(ParcelFileDescriptor.java:313)
[Glide] 	at android.os.ParcelFileDescriptor.open(ParcelFileDescriptor.java:211)
[Glide] 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1242)
[Glide] 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1170)
[Glide] 	at com.bumptech.glide.load.data.AssetFileDescriptorLocalUriFetcher.loadResource(AssetFileDescriptorLocalUriFetcher.java:20)
[Glide] 	at com.bumptech.glide.load.data.AssetFileDescriptorLocalUriFetcher.loadResource(AssetFileDescriptorLocalUriFetcher.java:11)
[Glide] 	at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:44)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherFailed(DecodeJob.java:412)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.onLoadFailedInternal(SourceGenerator.java:160)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator$1.onLoadFailed(SourceGenerator.java:83)
[Glide] 	at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.startNextOrFail(MultiModelLoader.java:167)
[Glide] 	at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onLoadFailed(MultiModelLoader.java:154)
[Glide] 	at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:50)
[Glide] 	at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherFailed(DecodeJob.java:412)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.onLoadFailedInternal(SourceGenerator.java:160)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator$1.onLoadFailed(SourceGenerator.java:83)
[Glide] 	at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.startNextOrFail(MultiModelLoader.java:167)
[Glide] 	at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onLoadFailed(MultiModelLoader.java:154)
[Glide] 	at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:50)
[Glide] 	at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
[Glide] 	at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
[Glide] 	at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
[Glide] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
[Glide] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
[Glide] 	at java.lang.Thread.run(Thread.java:764)
[Glide] 	at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
@JaneySprings JaneySprings added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Jul 19, 2022
@rmarinho rmarinho added area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Jul 20, 2022
@mattleibow
Copy link
Member

I believe you are missing the .aar file from you nuspec.

When building android libraries, the output contains the C# code in a dll and the resources and assets in a .aar file.

Make sure to add both to your nuspec. Let me know if this fixes it for you.

@mattleibow mattleibow added the s/needs-info Issue needs more info from the author label Nov 3, 2022
@ghost
Copy link

ghost commented Nov 3, 2022

Hi @JaneySprings. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@ghost ghost added the s/no-recent-activity Issue has had no recent activity label Nov 8, 2022
@ghost
Copy link

ghost commented Nov 8, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@ghost ghost closed this as completed Nov 11, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 s/needs-info Issue needs more info from the author s/no-recent-activity Issue has had no recent activity t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants