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

Fix import of xcassets to resources bundles in podspec #66

Merged
merged 4 commits into from
Jan 28, 2022

Conversation

pmusolino
Copy link
Member

In WCiOS during the last two years, we encountered a crash, that was happening during the first launch of the app on a new device (a new device, is that device that has never installed the application before). In particular, we encountered this crash woocommerce/woocommerce-ios#2454 that can be easily reproducible following these steps:

  1. Launch the simulator where you want to run the app.
  2. Go on the Device menu, and click Erase All content and settings....
  3. Run WCiOS on that simulator.
  4. Try to log in, adding your credentials.
  5. After adding your email, you will encounter a crash on the Gridicons library.

After several investigations, it appears that the problem is caused by the way we import xcassets resources into the podspec file of Gridicons.

Basically, before we were integrating the xcassets like this

s.resource_bundles = {
    Gridicons: [
      'Gridicons/Gridicons/*.{xcassets}'
    ]
  }

using as bundle name Gridicons which create a conflict at runtime. For solving this issue, I modified the bundle for the resources to GridiconsAssets like this:

s.resource_bundles = {
    GridiconsAssets: [
      'Gridicons/Gridicons/*.{xcassets}'
    ]
  }

plus I edited the code where we use the old bundle name. The reason for this conflict is well explained in this post.
After importing this branch in WCiOS, the issue was fixed and I'm no more able to reproduce the crash 🚀

Copy link
Contributor

@AliSoftware AliSoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed from my phone so I hope I didn't miss anything, but it's looking good! 👍

I'll let you push the Merge button then create a new GitHub Release (and thus 1.2.0 tag) — which should automatically make CI trigger a pod trunk push for you :shipit:

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

Successfully merging this pull request may close these issues.

2 participants