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

[BUG] Failed to find an image named icon_x_standalone #3156

Closed
clementmorissard opened this issue Jan 5, 2024 · 5 comments
Closed

[BUG] Failed to find an image named icon_x_standalone #3156

clementmorissard opened this issue Jan 5, 2024 · 5 comments
Labels
kind:bug triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@clementmorissard
Copy link

clementmorissard commented Jan 5, 2024

Summary

I'm having a crash on an image not found
StripeUICore/ImageMaker.swift:51: Assertion failed: Failed to find an image named icon_x_standalone

The weird thing is that the crash happens on the PaymentSheet.present, but it does not crash on the CustomerSheet.present somewhere else in the app...
And other thing which is weird, it seems that the crash only happens when i use the app when it's still linked to xcode

Code to reproduce

public func presentPaymentSheet(customerId: String, ephemeralKey: EphemeralKey, paymentIntentClientSecret: String, completion: @escaping (StripePaymentSheetResultEnum) -> Void) {

    var applePayConfiguration: PaymentSheet.ApplePayConfiguration? = nil
    if let merchantId = Bundle.main.object(forInfoDictionaryKey: "MerchantId") as? String {
        applePayConfiguration = PaymentSheet.ApplePayConfiguration(merchantId: merchantId, merchantCountryCode: "FR")
    }

    var configuration = PaymentSheet.Configuration()
    configuration.merchantDisplayName = "Rythmetech."
    configuration.customer = .init(id: customerId, ephemeralKeySecret: ephemeralKey.secret)
    configuration.appearance.font.base = RawFonts.latoLight.font(size: 14)
    configuration.appearance.colors.primary = Asset.DesignSystem.primaryColor
    configuration.appearance.colors.danger = Asset.Colors.redE4.color
    configuration.applePay = applePayConfiguration
    
    let paymentSheet = PaymentSheet(paymentIntentClientSecret: paymentIntentClientSecret, configuration: configuration)
    paymentSheet.present(from: sourceViewController!) { result in
        switch result {
        case .canceled:
            completion(.canceled)
        case .completed:
            completion(.completed)
        case .failed(let error):
            completion(.failed(error: error))
        }
    }`

iOS version

Installation method

I'm using cocoapods

def stripe_pods
pod 'Stripe', '> 23.20.0'
pod 'StripePaymentSheet', '
> 23.20.0'
end

def shared_pods
pod 'PhoneNumberKit', '> 3.7.0'
pod 'SwiftGen', '
> 6.6.0'
pod 'ScanditBarcodeCapture', '> 6.20.0'
pod 'RealmSwift', '
> 10.32.0'
pod 'Intercom', '~> 14.1.0'
pod 'MessageKit'

common_pods
stripe_pods
pod 'SGSegmentedProgressBarLibrary'
end

target "RythmePayment" do
project './RythmePayment/RythmePayment.xcodeproj'
common_pods
stripe_pods
end

target 'Rythme' do
shared_pods
firebase_pods

target 'RythmeTests' do
inherit! :search_paths
# Pods for testing
end

target 'RythmeUITests' do
# Pods for testing
end
end

`

But i'm using frameworks, so Rythme is using RythmePayment framework to present the PaymentSheet

SDK version

23.20.0'

Other information

I'm wondering if my podfile is wrong, and i got 2 instances of the stripe pod and there is a conflict

@yuki-stripe
Copy link
Collaborator

Hi @clementmorissard, can you try removing pod 'Stripe', '> 23.20.0' and running pod install again?

@yuki-stripe yuki-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Jan 5, 2024
@Mycose
Copy link

Mycose commented Jan 8, 2024

Hello @yuki-stripe, I justed tested to remove pod 'Stripe', '> 23.20.0' and changing my imports from import Stripe with import StripePaymentsSheet but i'm having the same crash

@Mycose
Copy link

Mycose commented Jan 8, 2024

I did some tests:

  var image = UIImage(
    named: imageName, in: BundleLocator.resourcesBundle, compatibleWith: traitCollection)

  if image == nil {
      image = UIImage(named: imageName, in: nil, compatibleWith: traitCollection)
  }

  if templateIfAvailable {
    image = image?.withRenderingMode(.alwaysTemplate)
  }

    print("ImageMakerBundleLocator = \(BundleLocator.resourcesBundle), imageName = \(imageName)")

  return image
}

I dont know if its normal to have the "not yet loaded" on the bundle

</var/containers/Bundle/Application/751A6ABF-2BDB-4909-BB3B-432FF9CA13C7/Rythme.app/Frameworks/StripePaymentSheet.framework/StripePaymentSheet.bundle> (not yet loaded), imageName = icon_x_standalone ImageMakerBundleLocator = NSBundle </var/containers/Bundle/Application/751A6ABF-2BDB-4909-BB3B-432FF9CA13C7/Rythme.app/Frameworks/StripeUICore.framework/StripeUICore.bundle> (not yet loaded), imageName = icon_chevron_down

@samirmakadia
Copy link

I am using latest version of stripe in iOS also facing same issue in device but in simulator it working fine so @yuki-stripe can you please solve this issue and update new version

@porter-stripe
Copy link
Collaborator

Closing this as stale! I believe we found the root cause of this in ~March 2024, if you are still hitting this issue please re-open.

@porter-stripe porter-stripe closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

No branches or pull requests

5 participants