Closed acrabb closed 1 year ago
Could you try with this binary framework, I'm just building it from v4.0.1 You can download then extract and drag it into your project. OmiseSDK401.xcframework.zip
Thanks @igroomgrim , the ios-arm64_i386_x86_64-simulator
version worked for the simulator. but now building for iOS (physical device) doesn't work with that binary.
The opposite error occurs:
Building for iOS, but the linked framework 'OmiseSDK.framework' was built for iOS Simulator.
Can we not have both iOS and iOS Simulator in the same binary? And if not, how can I include both in the project without changing binaries every time I switch from phone to sim?
Much appreciated.
@acrabb For that OmiseSDK.xcframework
you don't need to go inside the binary file and select .framework
by architecture.
You can drag and drop OmiseSDK.xcframework
directly to your project. It works both on Simulator and iOS device targets.
Example:
👍 🙇
@acrabb you can try using pod also. It's not official from Omise but you can try, I did and it can be applied successfully for my project. Let me know if you need any help. pod 'Omise', '4.0.1'
@wiosm Thanks for your project. 🙇 But @acrabb just be careful when you use not official SDK. You can use it, but it's at your own risk. 🔐 👌
Thanks @igroomgrim for some reason the xcframework is leaving me with a runtime error:
dyld: Library not loaded: @rpath...
Reason: image not found
Not sure what's going on 🤔
Is this Omise Build Phase still required?
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name 'OmiseSDK.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done
Think I fixed it by adding it to the Build Phase Embedded Frameworks
I swear I tried this many times before it actually worked.
Thanks Apple.
Running our project in Xcode 12 to a simulator gets the following build error:
Has anyone else seen this issue?