IOS native plugin for universal architecture - ios

I have a project in Unity3d that uses an iOS native plugin that I made in Xcode.
I use Unity3d v4.6.2 with Scripting Backend option in IL2CPP and Architecture option in "Universal"
Whem I run the project on my ipod5, it works but when I want to archive it, I have errors links with my library:
Undefined symbols for architecture arm64
with a warning that says
file was built for archive which is not the architecture being linked (arm64)
My library configuration is the following
http://imgur.com/AvbBYFo
and my list of iOS simulators is
http://imgur.com/XlSojzT
I try them all and none works
When I run the command
lipo -info mylib.a
I see the following information
input file mylib.a is not a fat file
Non-fat file: mylib.a is architecture: x86_64
I need my project to all the architecture, but do not know what else to configure.
Thanks for your help

Related

Convert library.a for macOSX to library.a for iOS

Is there a way to convert a library that is built for macOS to a library that I can use in my iOS project. I'm getting an error in my app that follows:
/Users/edwardpizzurro/Desktop/LibreriasAlternativas/LibreriasAlternativas.xcodeproj Building for iOS, but the linked library 'libsndfile.a' was built for macOS.
In general, it's not possible and you have to rebuild your library specifying iOS architecture.
To get more info about your library, run
lipo -info libsndfile.a
It'll give you architectures like armv7 armv7s i386 x86_64 arm64. A default architecture for iOS is arm64, while for MacOS it's x86_64 (we are not speaking of new M1 hardware). So most probably for your libsndfile.a you'll get only x86_64.
This will mean you need to build libsndfile by yourself.
Here are releases of this lib, there's no arm64 here: https://github.com/libsndfile/libsndfile/releases
So you have to donwload the repo: https://github.com/libsndfile/libsndfile
And use smth like Autotools to build it for your desired architecture.
A rough example of what you'll have to do it here: Can't cross compile C library for arm (iOS)
While it's quite specific for each library.

How to switch flutter plugin architecture from arm64 to armv7

When I tried to decrease my flutter app's deployment target (iOS 12 to 9.3), I received this error when running flutter build ios:
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
fatal error: lipo: -extract armv7 specified but fat file:
/Users/xxx/development/myapp/build/ios/Release-iphoneos/Runner.app/Frameworks/flutter_webview_plugin.framework/flutter_webview_plugin does not contain that architecture
Failed to extract armv7 for /Users/xxx/development/myapp/build/ios/Release-iphoneos/Runner.app/Frameworks/flutter_webview_plugin.framework/flutter_webview_plugin. Running
lipo -info:
Architectures in the fat file: /Users/xxx/development/myapp/build/ios/Release-iphoneos/Runner.app/Frameworks/flutter_webview_plugin.framework/flutter_webview_plugin are:
arm64
I am unable to find any information on how to change the architecture in question - can I even do this? Or is this something the plugin developer has to build in?
I would like to be able to run the app with the lowest possible iOS version for maximum compatibility.
In the project build settings, there is a section called Architectures, there you can set the ones you need. As far as I know, the latest iPhones need to use arm64, but in my picture you can see that I'm also set as valid armv7, that seems to be your problem.

framework not found OpenGLES for architecture x86_64

I have an Xcode Project, it is a Static Library Project. Now I need to make a Unity Plugin for Mac, so I have to convert my static library project to .bundle, I added a new Target in [macOS] -> [Bundle] (my Xcode version is 8.1) I named it as "AoneSDK". The source code from my static library had been compiled it "AoneSDK".
when I build "AoenSDK", the build failed. Error is
ld:framework not found OpenGLES for architecture x86_64
The "AoneSDK" is a bundle project , so it just supports Mac to build. And I am sure I didn't use OpenGELS.framework at all !!!
In short words your static library is not compiled for simulator (x86_64 architecture) try running on a device.
Open a terminal use lipo -info /path/to/your/library-file if it doesn't list x86_64 then this library is not compiled for simulatore find a fat library which is compiled for simulator (x86_64 architecture).

file was built for arm64 which is not the architecture being linked (x86_64)

I am building a framework first to use in my ios simulator. However I get this error when importing it into the main project:
file was built for arm64 which is not the architecture being linked
(x86_64)
Here is the build info of my framework:
UPDATE:
I created a universal framework using this technique: https://medium.com/#syshen/create-an-ios-universal-framework-148eb130a46c but I'm still getting the error
UPDATE: Results from running file on the binary:
hunterp$ file dinkle
dinkle: Mach-O universal binary with 2 architectures
dinkle (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
dinkle (for architecture arm64): Mach-O 64-bit dynamically linked shared library
I was incorrectly copying the binary framework and using an old one from before I changed it into a universal.
To create framework and convert .h file into .a fat file. Compile your project with simulator target and device target ,after these two tasks you have to join to make universal file with shell.

Lipo in not creating for arm64, armv7

I'm using the LAME MP3 encoder to convert the caf formatted file to MP3 format. I downloaded LAME and compile and build all architecture like arm64, armv7, armv7s, armv6, i386, i686, x86_64 successfully. I followed this link to create the libraries.
But I'm trying to create lipo for armv7, arm64, x86_64 which support to my project. But I'm getting fatal error.
Here is the error that I'm getting.
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: build/libmp3lame-arm64.a and build/libmp3lame-armv7.a have the same architectures (x86_64) and can't be in the same fat output file.
I tried the all combination which two architectures can create fat file, except single only creating. I need it for ios 8.1 and above (please mention which architectures should I put in the fat file for iPhone 4s and above)
It looks like something went wrong with your build: libmp3lame-arm64.a, libmp3lame-armv7.a should have been device builds but they seem to have come out as simulator builds.
You can confirm this by running file on them:
file build/libmp3lame-arm64.a build/libmp3lame-armv7.a
I don't know why it happened, nor which of many answers you used in the question you linked to.
Can you give more information on how you configured and built lame?

Resources