Error: "library not found for -lStripe" when building flutter app for ios

1,344

I opened an issue on GitHub for this problem.

The solution I found is:

  1. Changed deployment target to iOS 11.0 or later
  2. Close Xcode
  3. Install (or update to) the latest version of cocoapods gem install cocoapods
  4. Go to your project root directory and run flutter clean and flutter build ios
  5. Reopen Xcode and try to run your app
Share:
1,344
Tommimon
Author by

Tommimon

Updated on December 25, 2022

Comments

  • Tommimon
    Tommimon over 1 year

    I'm trying to build a Flutter app for ios (android app works)

    In this app I'm using the package stripe_payment to interact with the stripe APIs but when I build the app from Xcode I get this error library not found for -lStripe

    How can I solve it?

    Here is the full error log:

    Ld /Users/catalina/Library/Developer/Xcode/DerivedData/Runner-hgvbbahjovcxxohahkimphhvkars/Build/Products/Release-iphoneos/Runner.app/Runner normal (in target 'Runner' from project 'Runner')
            cd /Users/catalina/StudioProjects/my_project/ios
            /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk -L/Users/catalina/Library/Developer/Xcode/DerivedData/Runner-hgvbbahjovcxxohahkimphhvkars/Build/Products/Release-iphoneos -L/Users/catalina/Library/Developer/Xcode/DerivedData/Runner-hgvbbahjovcxxohahkimphhvkars/Build/Products/Release-iphoneos/Stripe -L/Users/catalina/Library/Developer/Xcode/DerivedData/Runner-hgvbbahjovcxxohahkimphhvkars/Build/Products/Release-iphoneos/flutter_secure_storage -L/Users/catalina/Library/Developer/Xcode/DerivedData/Runner-hgvbbahjovcxxohahkimphhvkars/Build/Products/Release-iphoneos/stripe_payment -L/Users/catalina/StudioProjects/my_project/ios/Flutter -F/Users/catalina/Library/Developer/Xcode/DerivedData/Runner-hgvbbahjovcxxohahkimphhvkars/Build/Products/Release-iphoneos -F/Users/catalina/StudioProjects/my_project/ios/Pods/../Flutter -F/Users/catalina/StudioProjects/my_project/ios/Pods/Stripe/InternalFrameworks/static -F/Users/catalina/StudioProjects/my_project/ios/Pods/Stripe/InternalFrameworks/static/Stripe3DS2.xcframework/ios-arm64 -F/Users/catalina/StudioProjects/my_project/ios/Pods/Stripe/InternalFrameworks/static/Stripe3DS2.xcframework/ios-arm64_x86_64-simulator -F/Users/catalina/StudioProjects/my_project/ios/Pods/Stripe/InternalFrameworks/static/Stripe3DS2.xcframework/ios-x86_64-maccatalyst -F/Users/catalina/StudioProjects/my_project/ios/Flutter -filelist /Users/catalina/Library/Developer/Xcode/DerivedData/Runner-hgvbbahjovcxxohahkimphhvkars/Build/Intermediates.noindex/Runner.build/Release-iphoneos/Runner.build/Objects-normal/arm64/Runner.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/catalina/Library/Developer/Xcode/DerivedData/Runner-hgvbbahjovcxxohahkimphhvkars/Build/Intermediates.noindex/Runner.build/Release-iphoneos/Runner.build/Objects-normal/arm64/Runner_lto.o -fobjc-arc -fobjc-link-runtime -ObjC -lStripe -lflutter_secure_storage -lstripe_payment -framework Contacts -framework CoreLocation -framework Flutter -framework Foundation -framework PassKit -framework Security -framework Stripe3DS2 -framework WebKit -framework Flutter -lStripe3DS2 -lPods-Runner -Xlinker -dependency_info -Xlinker /Users/catalina/Library/Developer/Xcode/DerivedData/Runner-hgvbbahjovcxxohahkimphhvkars/Build/Intermediates.noindex/Runner.build/Release-iphoneos/Runner.build/Objects-normal/arm64/Runner_dependency_info.dat -o /Users/catalina/Library/Developer/Xcode/DerivedData/Runner-hgvbbahjovcxxohahkimphhvkars/Build/Products/Release-iphoneos/Runner.app/Runner
    
    ld: library not found for -lStripe
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    I read that this may be the solution so here is what I have in the "Link Binary With Libraries" section

    enter image description here

    And this is what I see if click add and I search for stripe

    enter image description here

    Unfortunatly adding any of those doesn't solve the error

    EDIT:

    I changed target to my iPhone end now I'm getting "Framework not found Stripe3DS2"