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

IOS - Issue #311 still occurs not resolved. #320

Open
fbfdsouza opened this issue Nov 23, 2023 · 13 comments
Open

IOS - Issue #311 still occurs not resolved. #320

fbfdsouza opened this issue Nov 23, 2023 · 13 comments

Comments

@fbfdsouza
Copy link

the issue #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 fbfdsouza changed the title Issue #311 still occurs please only close it when resolved. Issue #311 still occurs not resolved. Nov 23, 2023
@fbfdsouza fbfdsouza changed the title Issue #311 still occurs not resolved. IOS - Issue #311 still occurs not resolved. Nov 23, 2023
@kahest kahest moved this from Needs Discussion to Needs Investigation in Mobile & Cross Platform SDK Nov 23, 2023
@lucas-zimerman
Copy link
Collaborator

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 lucas-zimerman moved this from Needs Investigation to Needs More Information in Mobile & Cross Platform SDK Nov 24, 2023
@fbfdsouza
Copy link
Author

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
Copy link
Author

@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)

@kahest kahest moved this from Needs More Information to Needs Investigation in Mobile & Cross Platform SDK Dec 22, 2023
Copy link

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 🥀

@fbfdsouza
Copy link
Author

fbfdsouza commented Dec 26, 2023

any updates on this issue?

@igorsantos07
Copy link

igorsantos07 commented Jan 2, 2024

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.

@lucas-zimerman
Copy link
Collaborator

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

@fbfdsouza
Copy link
Author

mac M1 here @lucas-zimerman

@lucas-zimerman
Copy link
Collaborator

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?

@fbfdsouza
Copy link
Author

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

@mirek-ppup
Copy link

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?

@luk156
Copy link

luk156 commented Aug 19, 2024

i've the same problem

@mirek-ppup
Copy link

i've the same problem

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Investigation
Development

No branches or pull requests

6 participants