Open sebastianLIFEtool opened 2 years ago
Hi
Can I check what symbols there may be here that you're missing? if you have a couple of examples, we can see if these are something that have been added only in the latest iPhone SDK. I'm a little curious though as, even if you're using the latest Xcode, it shouldn't use 'new' symbols from the SDK if you're targeting an older iPhone version (well, that may be my false assumption...)
FYI we're shortly going to be releasing a version of AIR that is also built with Xcode 14.1 and uses iPhoneOS 16 SDK which I would hope solves this if we haven't found any other workaround..
thanks
Thank you for your quick response. Here are some of the symbols that are missing. The error message contains a lot more, as far as I can tell every call to the iOS SDK causes an error.
"_objc_msgSend$canOpenURL:",
"_objc_msgSend$generalPasteboard:"
"_objc_msgSend$stringWithUTF8String:"
I assume they are cause by:
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:urlScheme]];
UIPasteboard* pasteboard= [UIPasteboard generalPasteboard];
[NSString stringWithUTF8String:(char*)path];
As far as I can tell we do not use any new symbols and have not yet added any code since the update to Xcode 14.1. And it was working fine before. If you need any further information please let me know.
Best regards
Just ran a quick test with 33.1.1.935, and Xcode 14.1. As you said had to update the minimum ios version and sdk version to 11.0 but I could build a couple of our extensions and they packaged successfully.
Only issues we've run into are some with frameworks that use some of the newer SDK / swift functionality / build tools, but if you are building it yourself you shouldn't have those issues.
Are you using the platformsdk option at all?
Thank you for the tip with the platformsdk. I have never used the option because I never needed it. I copied the SDK from Xcode (iPhoneOS16.1sdk) and linked it with my project immediately running into to following error:
Id: framework not found WebKit
Compilation failed while executing: Id64
I assume this caused by the fact that the WebKit.framework (along with some other frameworks) is just a link in the iPhoneOS16.1 SDK. So i copied the actual framework files into the SKD folder however thes led to a new error:
Id: file too small (length=12) for architecture arm64
Compilation failed while executing: Id64
Following that I found the iPhoneOS SDKs on the internet and decided to give them a shot. Since the downloaded iPhoneOS16.1.sdk also failed to deploy, i decided to try all the others as well. The SDKs prior to 14.0 resulted in the Undfined symbols for architecture arm64
as described inmy first post. All newer SDKs resulted in:
Id: unexpected token: !api-tbd for architecture
Compilation failed while executing: Id64
If you have any other suggestions I would be happy to try them. Otherwise I will be waiting for the version of AIR that is built with Xcode 14.1 and iPhoneOS 16 SDK. Hoping that will fix all issues. As I said before, I don't even understand what is causing the issue in the first place since we do not use any functionality that would require an SDK newer that 10.0. And I did not change the native code, all I did was to change the iOS Target Platform to 11.0 as that is the min version required by Xcode 14.1.
Best regards
I think "copied the SDK from Xcode" is a bit of a non-starter I'm afraid. You can use -platformsdk to point to an existing SDK, but if you try to use it directly then it's going to run into the problem that the iPhone SDK files are just text files describing the symbols that are available; the AIR SDK turns these into stubbed binaries that are then used for linking..
generalPasteboard
I couldn't find anywhere in the .tbd files though! Looking in iPhone SDK 15.0 and 16.0 and I can see a lot of UIPasteboard
functions in UIKit, but no generalPasteboard
symbol in the .tbd file - it's in an .h file but nothing further. Same for the others .. which means that in our stub binaries, we don't have that symbol. But I just checked in Adobe's equivalents and the same is happening there...
I suspect then, the issue should be resolved via the ANE's linker options.. although I'm not 100% sure what they should be. But I'm thinking that the update from our side for iOS 16 isn't actually going to help :-(
@sebastianLIFEtool Oh, yeah I was meaning don't use it, as it may be linking against an older sdk inadvertently. The latest SDKs are a lot harder to extract as Andrew mentioned so we have stopped providing them, especially since Harman have been reasonably quick to update the AIR SDK with them recently.
@marchbold Oh I misunderstood, but we did not use them before anyway. It was still worth a try.
@ajwfrost By ANE linker options you mean the options in Xcode? Or the paltform.xml?
Fortunately we can still use our old ANE for now as the new functions I was going to add are not required immediately. I will continue to play with some options and if that does not work, I will likely go ahead and create an ANE from scratch to see if I can get anything to work. (I kind of already did that, but I used some stuff from our existing ANE. Maybe a real scratch build is better). Thank you guys again for your help.
@sebastianLIFEtool well I'd meant the options in the platform.xml file, but I'm wondering whether it's something that would be included in the .a file from Xcode. The odd thing I feel is that there's a method declared in the .h file but with no definition of this in the .tbd/.dylib file...
So basically, I have no idea where these symbols are actually being defined, and if you set up a new normal application and used those methods, I would be interested to see the details of how it links and where they come from.....!
We are with the same issue!!
This is very urgent for us because we have LiveOps event next week and we are not able to build our IPAs.
We are using AIR 50.0.1.3.
Is there any work around?
I forgot the logs:
ld: in /var/folders/ks/fsng9hxn5776jq_jmkfhk46w0000gp/T/149abd7b-8478-4df6-b167-4170f08955df/BUAdSDK.framework/BUAdSDK(BUAdSDKManager.o), could not parse object file /var/folders/ks/fsng9hxn5776jq_jmkfhk46w0000gp/T/149abd7b-8478-4df6-b167-4170f08955df/BUAdSDK.framework/BUAdSDK(BUAdSDKManager.o): 'Invalid bitcode version (Producer: '1300.0.29.3.0_0' Reader: '1200.0.32.29_0')', using libLTO version 'LLVM version 12.0.0, (clang-1200.0.32.29)' file '/var/folders/ks/fsng9hxn5776jq_jmkfhk46w0000gp/T/149abd7b-8478-4df6-b167-4170f08955df/BUAdSDK.framework/BUAdSDK' for architecture arm64
Compilation failed while executing : ld64
I have the same error using Adobe air 33.1.1.889
ld: in /var/folders/ks/fsng9hxn5776jq_jmkfhk46w0000gp/T/4d50d397-53a7-456b-89de-4b8c03cbe94a/BUAdSDK.framework/BUAdSDK(BUAdSDKManager.o), could not parse object file /var/folders/ks/fsng9hxn5776jq_jmkfhk46w0000gp/T/4d50d397-53a7-456b-89de-4b8c03cbe94a/BUAdSDK.framework/BUAdSDK(BUAdSDKManager.o): 'Invalid bitcode version (Producer: '1300.0.29.3.0_0' Reader: '1200.0.32.29_0')', using libLTO version 'LLVM version 12.0.0, (clang-1200.0.32.29)' file '/var/folders/ks/fsng9hxn5776jq_jmkfhk46w0000gp/T/4d50d397-53a7-456b-89de-4b8c03cbe94a/BUAdSDK.framework/BUAdSDK' for architecture arm64
@marchbold I think this is related with some new version of distriqt ANEs due Adobe air 33.1.1.889 was working fine for ios with old anes.
What is BUAdSDK.framework
built with? and what are you running on currently, that's a macOS machine but what version and which Xcode have you got?
BUAdSDK.framework
is from the Pangle Ad network I believe?
It makes sense because we introduced this Ane (pangle) recently. We will try without this Ane.
Em sex., 18 de nov. de 2022 21:21, Michael @.***> escreveu:
BUAdSDK.framework is from the Pangle Ad network I believe?
— Reply to this email directly, view it on GitHub https://github.com/airsdk/Adobe-Runtime-Support/issues/2299#issuecomment-1320691922, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFCZGYPQUDJL6ATEP6N6OQTWJAMQPANCNFSM6AAAAAASB5OBNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
After remove the pangle ane everything worked fine!
@marchbold the problem is the Pangle on iOS.
Interesting .. any chance I can get hold of the ANE to see what's happening in detail when it tries to link? (and to see just in case that is solved with the latest builds of our code using Xcode 14.1)?
thanks
@megajogos is this the pangle admob mediator?
@ajwfrost You can find it here: https://github.com/distriqt/ANE-Adverts-Mediation/releases/tag/v6.5.0
Thanks .. curiously, on my mac (Ventura with Xcode 14.1) this isn't showing any problems at all when I just add this into a project, using 50.0.1.3. Likewise on an older machine with Big Sur and Xcode 13.0...
On Windows I'm getting an odd error:
ld: file is universal (2 slices) but does not contain the arm64 architecture: ...BUAdSDK.framework/BUAdSDK for architecture arm64
although lipo has confirmed that it does have the right sections:
lipo.exe -info extracted\iPhone-ARM\BUAdSDK.framework\BUAdSDK
Architectures in the fat file: extracted\iPhone-ARM\BUAdSDK.framework\BUAdSDK are: armv7 arm64
So this may just be that the build of ld
on Windows is a bit out of date now.. but I believe folk in the thread above were all using macOS?
The actual file showing an error is some LLVM bitcode so I assume this was generated with a compatibility in there that means that the macOS linker can't cope with it as it's too new; at a guess then, either the file should be generated with some old/backwards compatibility set up, or the macOS linker needs to be updated..
thanks
I have just finished setting up a completely new ANE and a Test Project an the errors still occur. However, after reading the latest post from @ajwfrost, I tried to deploy from MacOS and the app worked just fine. The error seems to be limited to the Windows platform.
So, any ideas on how this can be fixed? Will it be tackled by HARMAN? As I stated above, it is not critical for us at the moment, as we still have or old ANE, but at some point we need to make updates.
If required, I could provide the ANE I just build. However it does nothing fancy, and only contains one function:
FREObject getAuthor(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[])
{
FREObject author;
NSString* authorString = [NSString stringWithFormat:@"%@", @"Sebastian"];
FRENewObjectFromUTF8(9, (const uint8_t*)[authorString UTF8String], &author);
//FRENewObjectFromUTF8(9, (const uint8_t*)"Sebastian", &author);
return author;
}
The issues are cause by stringWithFormat
and UTF8String
. Replace the two lines with FRENewObjectFromUTF8(9, (const uint8_t*)"Sebastian", &author);
and the ANE will work.
Best regards Sebastian
Hi @sebastianLIFEtool
I think we had two errors in this thread, the original one you posted regarding undefined symbols such as
"_objc_msgSend$canOpenURL:",
"_objc_msgSend$generalPasteboard:"
"_objc_msgSend$stringWithUTF8String:"
so is that the same sort of issue you're seeing now? and was the earlier problem also only showing up on Windows - presumably of course, the ANE was built using Xcode 14.1 on a recent macOS.
In terms of us trying to sort this out, we basically need to cross-compile the Apple linker to run it on Windows... With Xcode 14.1 we have the following:
% ld -v
@(#)PROGRAM:ld PROJECT:ld64-819.6
BUILD 21:47:32 Sep 13 2022
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 14.0.0, (clang-1400.0.29.102) (static support for 29, runtime is 29)
i.e. ld64-819.6
The Apple open source website doesn't have this version, max seems to be v609. Not actually sure what version is the one that Adobe created, it just says 1BUILD 15:13:42 Feb 20 2019
. But v609 seems to be later than this, just need to hope that it's suitable...
https://opensource.apple.com/source/ld64/
thanks
@marchbold we are using com.distriqt.admob.Pangle version 4.7.0 and it is working fine on Android.
@megajogos I think that is a separate issue (though maybe related) and could you start a new issue in the adverts mediation tracker and we'll look into it.
@ajwfrost @sebastianLIFEtool Can confirm the same issues from our side, macOS is working fine, but the ld on Windows is failing with those mentioned issues when an ANE uses a lib compiled with Xcode 14.
Eg output from our Application Rater ANE on windows (ref: https://github.com/distriqt/ANE-ApplicationRater/issues/74):
Hi @ajwfrost,
yes, the issue I am seeing now is still the same as in my original post. I just wanted to verify that the issue is limited to Windows. Can you please keep us updated, if the new linker will work?
Thank you
Hi @sebastianLIFEtool - just to let you know, we've got an ld64 version building on macOS but it looks like it may take a bit of time before we can get this working on Windows too. We're doing a release shortly with updates for everything on the latest macOS/iPhone platforms, but it's not going to work on Windows yet....
Thank you @ajwfrost, for working on it. Please let us know when you manage to get it to work on Windows again. Until then we will have to use our old ANE.
Best regards.
Would be good to get this one through, unfortunately we still have a lot of people doing iOS development on windows so can't update a lot of our extensions.
Hi all -> the update for this is out now. We haven't managed to get an updated linker (it seems that Apple hadn't yet released the newer one that copes with the Xcode changes into their Open Source repo yet..) but have managed to update the runtime build settings so that the existing linker copes with it.
But, @sebastianLIFEtool, @marchbold and others who are packaging up ANEs that are built with Xcode 14: you would need to build with an extra C/C++ flag in the additional compiler settings, to include -fno-objc-msgsend-selector-stubs
thanks
What does this mean for frameworks outside our control though that are compiled with xcode 14?
I'll do some investigating but our major issue isn't with code we compile but with SDKs/Frameworks that are compiled by other companies.
Hi @ajwfrost,
I just build our native extension with the latest version of the SDK and the additional Xcode compiler flag and I can confirm that it is working now. Thank you for the good work.
Best regards
(Looking good for iOS frameworks too, just need to do some testing on windows as well though).
@ajwfrost I have this issue after update iOS native extension to Xcode 14.2. IPA packaging errors only with Windows devices. There is no such issues using macOS to build IPA.
Undefined symbols for architecture arm64:
"_objc_msgSend$setBool:forKey:", referenced from:
_requesterEnabled in C:\Users\username\AppData\Local\Temp\ea806ca9-4118-46d2-ba83-08002bc2519e\libcom.my.app.a(RequesterEnabled.o)
"_objc_msgSend$removeObjectForKey:", referenced from:
_resetData in C:\Users\username\AppData\Local\Temp\ea806ca9-4118-46d2-ba83-08002bc2519e\libcom.my.app.a(ResetData.o)
_requesterEnabled in C:\Users\username\AppData\Local\Temp\ea806ca9-4118-46d2-ba83-08002bc2519e\libcom.my.app.a(RequesterEnabled.o)
"_objc_msgSend$currentDevice", referenced from:
_getVersionNumber in C:\Users\username\AppData\Local\Temp\ea806ca9-4118-46d2-ba83-08002bc2519e\libcom.my.app.a(VersionNumber.o)
"_objc_msgSend$doubleValue", referenced from:
_getVersionNumber in C:\Users\username\AppData\Local\Temp\ea806ca9-4118-46d2-ba83-08002bc2519e\libcom.my.app.a(VersionNumber.o)
"_objc_msgSend$hookedApplication:openURL:sourceApplication:annotation:", referenced from:
-[HookUtils hookedApplication:openURL:sourceApplication:annotation:] in C:\Users\username\AppData\Local\Temp\ea806ca9-4118-46d2-ba83-08002bc2519e\libcom.my.app.a(HookUtils.o)
"_objc_msgSend$hookedApplicationWillEnterForeground:", referenced from:
-[HookUtils hookedApplicationWillEnterForeground:] in C:\Users\username\AppData\Local\Temp\ea806ca9-4118-46d2-ba83-08002bc2519e\libcom.my.app.a(HookUtils.o)
...
-fno-objc-msgsend-selector-stubs
Xcode compiler flag didn't help for me.
Are you able to re-check the build with that Xcode compiler flag? Definitely cleaning up everywhere before building? You should be able to check the symbols in your .o files (once it's compiled with Xcode i.e. on your mac) to ensure you don't have these objc_msgSend$....
values.
The Apple linker (available on mac with the latest Xcode) works fine with those formats, but they've not (yet?) issued the source code for that so we're not able to get this working on Windows.
thanks
Definitely check the compiler flag. I can confirm the compiler flag is working for us, just about completed the update to all our extensions...
@ajwfrost, @marchbold
Thank you. Indeed, this flag solve this issue. I need to add it to "Other C Flags" to fix it. It automatically will be added to "Other C++ Flags" too.
Previously I have added -fno-objc-msgsend-selector-stubs
only to "Other C++ Flags" and it didn't help.
Problem Description
We have a native extenion for our iPad/iPhone apps and resently updated to the latest version of Xcode (14.1). Since this version supports only arm64 builds, I updated our ANE and apps to only support iOS 11 or newer as previous version would require a universial binary. Compiling the ANE worked fine, however I ran into an issue when deploying our app to a device or packaging a release build. I keep getting a lot of
Undfined symbols for architecture arm64
errors, basically for every iOS function I call.When I check the native library with the
lipo
command I get:So I assume, the the library is not the problem.
The iOS Deployment Target in Xcode is set to 11.0, the minimum os version in the app-xml is set to the same value
I use the following plattform.xml for the iOS ANE build:
Having set the sdk version to 11.0 to avoid needing universal binaries and containing all frameworks used in the native code.
I even created a new native extension that does nothing but show an alert view, but the undefined symbols error still persists.
We currently use FLEX with AIR SDK 33.1.1.821, however I also checked with AIR 33.1.1.935 and AIR 50.0.1.3. I might be missing somethin obvious, but I am all out of ideas.
Any help is appreciated Best regards Sebastian