xcasset folder in iOS class library breaks UIImage.FromBundle in main app

tokotoko USMember ✭✭

Hello everyone,

first of all, attached you find a sample project that makes it very simple to understand the problem. See MyViewControllerInt line 26 for a description in code.

The problem is the following:

  • I have an iOS app that references one iOS class library that i created
  • If i add an xcassets folder to the class library i can not load any assets in the main app anymore -> UIImage.FromBundle returns null
  • After archiving and having a look at the assets.car file only the assets from the class library were added

@Xamarin Team: Is this supported in general, having assets in a iOS class library? Should this scenario work?

@Everyone else: Anyone experienced similar issues? Any ideas how to solve it?

Thanks a lot for your help!

Best,
Tobias

Posts

  • tuyenvtuyenv VNUniversity ✭✭✭

    We faced the same issue. We workaround by include all resources in a single xcassets :).

  • tokotoko USMember ✭✭

    Thanks for your feedback!

    We are aiming for a highly modularised approach, so doing that is quite a big hit for our architecture. I'll try to get more info if this is a bug or is not supposed to work at all.

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai

    @toko

    This has been a known issue for a while: https://bugzilla.xamarin.com/show_bug.cgi?id=34762
    and as noted in the comments on the bug report changing this behavior will not be trivial.

Sign In or Register to comment.