alexsorokoletov / objc-automatic

[Not supported anymore] Automation tool to bind CocoaPods to NuGet packages for Xamarin.iOS
45 stars 15 forks source link

error: Resource "Stripe.bundle" not found. Run 'pod install' to update the copy resources script. #6

Open pragmaprog opened 6 years ago

pragmaprog commented 6 years ago

There is an error converting Stripe cocoapod to nuget package.

The following build commands failed: PhaseScriptExecution [CP]\ Copy\ Pods\ Resources /Users/artplastika/Library/Developer/Xcode/DerivedData/EmptyProject-evtvslopwzosevgcuhljsxzvntrc/Build/Intermediates.noindex/EmptyProject.build/Debug-iphoneos/EmptyProject.build/Script-F377D21E1012020380B2AA69.sh (1 failure) Running build failed. Error: System.Exception: Error during xcodebuild clean build -workspace EmptyProject.xcworkspace -scheme EmptyProject -sdk "iphoneos" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO SYMROOT=/Users/artplastika/objc-automatic-master/pods/Stripe/XCode/build-out CONFIGURATION_BUILD_DIR=/Users/artplastika/objc-automatic-master/pods/Stripe/XCode/build-out at Microsoft.FSharp.Core.PrintfModule+PrintFormatToStringThenFail@1379[TResult].Invoke (System.String message) [0x00001] in <5893d081904cf4daa745038381d09358>:0 at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv1[TResult].Finalize () [0x00012] in <5893d081904cf4daa745038381d09358>:0 at Microsoft.FSharp.Core.PrintfImpl+Final1@224[TState,TResidue,TResult,A].Invoke (Microsoft.FSharp.Core.FSharpFunc2[T,TResult] env, A a) [0x00038] in <5893d081904cf4daa745038381d09358>:0 at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) [0x00001] in <5893d081904cf4daa745038381d09358>:0 at FSI_0005.Build.compileNonFrameworkProjectForArchitecure (System.String podName, System.Boolean sim, System.String podXCodeDir, System.String buildOutDir) [0x00099] in :0 at FSI_0005.Build.compileNonFrameworkProject (FSI_0005.Build+Pod pod) [0x000e5] in :0 at FSI_0005.Build.generateBindingForPod (FSI_0005.Build+Pod pod) [0x000e1] in :0 at FSI_0005.Build+clo@776-4.Invoke (FSI_0005.Build+Pod pod) [0x00001] in :0 at Microsoft.FSharp.Primitives.Basics.List.iter[T] (Microsoft.FSharp.Core.FSharpFunc2[T,TResult] f, Microsoft.FSharp.Collections.FSharpList1[T] x) [0x00019] in <5893d081904cf4daa745038381d09358>:0 at Microsoft.FSharp.Collections.ListModule.Iterate[T] (Microsoft.FSharp.Core.FSharpFunc2[T,TResult] action, Microsoft.FSharp.Collections.FSharpList1[T] list) [0x00001] in <5893d081904cf4daa745038381d09358>:0 at FSI_0005.Build+clo@765-2.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x000ed] in :0 at Fake.TargetHelper+targetFromTemplate@209-1[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00001] in <5978411fccf1c534a74503831f417859>:0 at Fake.TargetHelper.runSingleTarget (Fake.TargetHelper+TargetTemplate`1[a] target) [0x0004b] in <5978411fccf1c534a74503831f417859>:0

Here is verbose output: https://gist.github.com/artplastika/4270045325d3d1269fb217e9ff9a5894

alexsorokoletov commented 6 years ago

@artplastika thank you for trying the tool and opening the issue. I can reproduce it, probably, resource got lost during conversion.

Looking into it.

alexsorokoletov commented 6 years ago

Related to this https://github.com/cocoapods/cocoapods/issues/5034 - somehow recent updates to cocoapods changed directory structure I was relying on.

alexsorokoletov commented 6 years ago

Update on this issue: Still not sure why the process is breaking (i.e. root cause - XCode or Cocoapods update?). Was able to fix that locally by providing different set of options to the XCode build process (and thus get binding generated).

However, Stripe SDK distributed via cocoapods is not a .framework but rather set of files (that go into framework when they distribute it as a static framework). Because of that, the resource bundle they're creating in a build time is not being detected by objc-automatic and it's missing from the generated binding. You can add it manually.

I'm going to review and test changes I did for Stripe support on other pods to make sure we're not breaking anything.

Meanwhile, there is an existing binding for Stripe for Xamarin: https://github.com/XAM-Consulting/xios-stripe

It is using SDK distributed as a static framework https://stripe.com/docs/mobile/ios