sentry-cordova icon indicating copy to clipboard operation
sentry-cordova copied to clipboard

IOS - Issue #311 still occurs not resolved.

Open fbfdsouza opened this issue 1 year ago • 13 comments

the issue https://github.com/getsentry/sentry-cordova/issues/311 still occurs, and not being able to extract the arm64 architecture from the path since it's not a fat file, makes it impossible to publish on the app store.

Tried the latest sentry-cordova 1.2.0, same issue is happening.

image

fbfdsouza avatar Nov 23 '23 13:11 fbfdsouza

Hi, could you share your Sentry strip unused archs form Framework script that is used on your project? Also is the project working if you remove this script?

lucas-zimerman avatar Nov 24 '23 12:11 lucas-zimerman

I used this

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 '*.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=()
GOOD_ARCHS=()
PRESENT_ARCHS=($(lipo -archs "$FRAMEWORK_EXECUTABLE_PATH"))
if [[ "${#PRESENT_ARCHS[@]}" -lt 2 ]]; then
    echo "Framework is not a Fat binary, skipping..."
    continue
fi
for ARCH in "${PRESENT_ARCHS[@]}"; do
    if [[ "$ARCH" != x86_64 && "$ARCH" != i386 ]]; then
        echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
        lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
        GOOD_ARCHS+=("$ARCH")
        EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
    fi
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

but it will skip the Sentry framework because it is not a Fat binary and I believe this is why it won't even work for sending errors to Sentry on Ios...

not using this script at all seems not to produce any errors, I'm not sure if the binaries are extracted correctly though... I will try to see if the step for publishing on the app store won't fail and if iOS can send errors to sentry...

fbfdsouza avatar Nov 27 '23 18:11 fbfdsouza

@lucas-zimerman We did the publishing step removing the unused architectures script and it got broken... we're not able to send it to the Apple store.

Error: [13:10:42]: ERROR: Asset validation failed (90087) Unsupported Architectures. The executable for OurProjectName.app/Frameworks/Realm.framework contains unsupported architectures '[x86_64, i386]'. (ID: 545d4a32-b2fc-4f00-b907-3856872d0790)

fbfdsouza avatar Dec 04 '23 13:12 fbfdsouza

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Dec 26 '23 00:12 github-actions[bot]

any updates on this issue?

fbfdsouza avatar Dec 26 '23 09:12 fbfdsouza

Looking forward to get this solved for real - we're stuck without Cordova on our app for many months 😞


Edit: I'm unable to make sure it's working because I can't even get the lib to run properly in our scenario. I'm not sure it ever worked 100% correctly inside Cordova. See referred issue below.

igorsantos07 avatar Jan 02 '24 01:01 igorsantos07

Hi, are you running on a Mac M1 or Intel? also which targets are you building your app? (Iphone, Ipad, mac,...)?

lucas-zimerman avatar Jan 05 '24 12:01 lucas-zimerman

mac M1 here @lucas-zimerman

fbfdsouza avatar Jan 05 '24 13:01 fbfdsouza

Thanks for answering, we'll investigate this issue further more. Additional, are you targeting only iPhones/iPad? or other platforms like MacOS or apple watch?

lucas-zimerman avatar Jan 19 '24 12:01 lucas-zimerman

hi thanks @lucas-zimerman, we in our case only iphones.

fbfdsouza avatar Jan 19 '24 12:01 fbfdsouza

I have the same issue, after upgrading from cordova 10 to cordova 12. Build is running on Intel machine.

Have you ever found any workaround?

mirek-ppup avatar May 17 '24 21:05 mirek-ppup

i've the same problem

luk156 avatar Aug 19 '24 10:08 luk156

i've the same problem

The fix I implemented was to remove Sentry from the Cordova apps.

mirek-ppup avatar Aug 19 '24 12:08 mirek-ppup