stickers icon indicating copy to clipboard operation
stickers copied to clipboard

[iOS] Build of framework including WebP.framework for achitecture arm64 not working

Open rafagan opened this issue 4 years ago • 6 comments

Problem Description
When I compile a xcframework with WebP embedded with the headers, I receive the error bellow:

ld: in /Users/Projects/libs/ikolb-apps-libs/WebP.framework/WebP(libwebpencode_la-config_enc.o), building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
	Ld /Users/rafagan/Library/Developer/Xcode/DerivedData/iKolbAppsLibs-aamrawtqkbohumbztkmrcnjeixgh/Build/Intermediates.noindex/iKolbAppsLibs.build/Release-iphonesimulator/iKolbAppsLibs.build/Objects-normal/arm64/Binary/iKolbAppsLibs normal arm64
(1 failure)

There's a way to provide this library with arm64 support?

Reproduction Steps
Run something like below in shell:

xcodebuild archive \
	-scheme $FRAMEWORK_NAME \
        -configuration Release \
	-project "${PROJECT_DIR}" \
	-archivePath "${TMP_DIR}/simulator/$FRAMEWORK_NAME" \
	-verbose \
	-sdk iphonesimulator \
	SKIP_INSTALL=NO \
	BUILD_LIBRARIES_FOR_DISTRIBUTION=YES \
	clean build

rafagan avatar Sep 02 '21 21:09 rafagan

@rafagan @amrit-1901 hello, I'm having the same issue. Any updates on this?

leonardo-ferreira07 avatar Jan 10 '22 07:01 leonardo-ferreira07

Any workaround?

piscespieces avatar Jul 05 '22 01:07 piscespieces

Still running into this issue, can't run the app on my m1 mac

ronnienv avatar Sep 30 '22 06:09 ronnienv

Got it working by just changing Architectures to x86_64 for your project at the root image

nikolaigeorgie avatar Jun 12 '23 23:06 nikolaigeorgie

Got it working by just changing Architectures to x86_64 for your project at the root image

My solution only works for simulator :(

nikolaigeorgie avatar Jun 30 '23 19:06 nikolaigeorgie

Got it working by just changing Architectures to x86_64 for your project at the root image

My solution only works for simulator :(

ok here you go , heres a little, this is just for local development to build to ios simulator but for deployment (say with expo) this script doesn't need to run so just make sure that the architecture is standard for deployment node.js script i created

`const fs = require("fs")

const filePath = "./ios/app.xcodeproj/project.pbxproj"

fs.readFile(filePath, "utf8", function (err, data) { if (err) { return console.log(err) }

let result = data.replace(/ARCHS = "$(ARCHS_STANDARD)";/g, "ARCHS = x86_64;")

fs.writeFile(filePath, result, "utf8", function (err) { if (err) return console.log(err) console.log("File has been successfully updated") }) })`

nikolaigeorgie avatar Jul 04 '23 22:07 nikolaigeorgie