airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
206 stars 11 forks source link

iOS Undefined symbols for arm64 after Xcode update #2299

Open sebastianLIFEtool opened 2 years ago

sebastianLIFEtool commented 2 years ago

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:

Non-fat file: libExtensionManager.a is architecture: arm64

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

<key>MinimumOSVersion</key>
<string>11.0</string>

I use the following plattform.xml for the iOS ANE build:

<platform xmlns="http://ns.adobe.com/air/extension/33.1">
    <sdkVersion>11.0</sdkVersion>
    <linkerOptions>
        <option>-ios_version_min 11.0</option>
        <option>-framework MediaPlayer</option>
        <option>-framework AVFoundation</option>
        <option>-framework AVKit</option>
        <option>-framework UIKit</option>
        <option>-framework StoreKit</option>
        <option>-framework WebKit</option>
        <option>-framework MessageUI</option>
        <option>-framework CoreGraphics</option>
        <option>-framework QuartzCore</option>
        <option>-framework Security</option>
        <option>-framework Foundation</option>
        <option>-liconv</option>
    </linkerOptions>
</platform>

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

ajwfrost commented 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

sebastianLIFEtool commented 2 years ago

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

marchbold commented 2 years ago

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?

sebastianLIFEtool commented 2 years ago

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

ajwfrost commented 2 years ago

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 :-(

marchbold commented 2 years ago

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

sebastianLIFEtool commented 2 years ago

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

ajwfrost commented 2 years ago

@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.....!

megajogos commented 2 years ago

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?

megajogos commented 2 years ago

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
megajogos commented 2 years ago

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.

ajwfrost commented 2 years ago

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?

marchbold commented 2 years ago

BUAdSDK.framework is from the Pangle Ad network I believe?

Elintondm commented 2 years ago

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: @.***>

megajogos commented 2 years ago

After remove the pangle ane everything worked fine!

@marchbold the problem is the Pangle on iOS.

ajwfrost commented 2 years ago

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

marchbold commented 1 year ago

@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

ajwfrost commented 1 year ago

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

sebastianLIFEtool commented 1 year ago

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

ajwfrost commented 1 year ago

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

megajogos commented 1 year ago

@marchbold we are using com.distriqt.admob.Pangle version 4.7.0 and it is working fine on Android.

marchbold commented 1 year ago

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

Log output ``` Error occurred while packaging the application: Undefined symbols for architecture arm64: "_objc_msgSend$review", referenced from: _ApplicationRater_review_isSupported in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _ApplicationRater_review_requestReview in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$newFREObjectFromBoolean:", referenced from: _ApplicationRater_review_isSupported in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _ApplicationRater_review_requestReview in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _firebasecore_isSupported in C:\Users\user\AppData\Local\Temp\a8a82946-2439-4877-81f1-91b6c53d9ec6\libcom.google.firebase.core.a(FirebaseCore.o) "_objc_msgSend$retrieveApplicationId", referenced from: _ApplicationRater_retrieveApplicationId in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$getInstallerStore", referenced from: _ApplicationRater_getInstallerStore in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$showRateDialog:title:message:rateLabel:declineLabel:laterLabel:", referenced from: _ApplicationRater_showRateDialog in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$formatForEvent:", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$init", referenced from: +[DTARApplicationIDEvent formatForEvent:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationIDEvent.o) +[DTARApplicationIDEvent formatForErrorEvent:error:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationIDEvent.o) -[DTARApplicationRaterController review] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) _ApplicationRaterContextInitializer in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _firebasecoreContextInitializer in C:\Users\user\AppData\Local\Temp\a8a82946-2439-4877-81f1-91b6c53d9ec6\libcom.google.firebase.core.a(FirebaseCore.o) "_objc_msgSend$getViewController", referenced from: -[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$formatForErrorEvent:error:", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$log:message:", referenced from: -[DTFBCAIRExtensionContext log:message:] in C:\Users\user\AppData\Local\Temp\a8a82946-2439-4877-81f1-91b6c53d9ec6\libcom.google.firebase.core.a(DTFBCAIRExtensionContext.o) -[DTARReviewController isSupported] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARReviewController.o) -[DTARReviewController requestReview] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARReviewController.o) -[DTARApplicationRaterController retrieveApplicationId] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) -[DTARApplicationRaterController retrieveApplicationIdForBundleId:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) -[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) -[DTARApplicationRaterController redirectToApplicationPage:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) ... "_objc_msgSend$infoDictionary", referenced from: -[DTARApplicationRaterController retrieveApplicationId] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$dispatchStatusEvent:code:level:", referenced from: -[DTFBCAIRExtensionContext dispatch:data:] in C:\Users\user\AppData\Local\Temp\a8a82946-2439-4877-81f1-91b6c53d9ec6\libcom.google.firebase.core.a(DTFBCAIRExtensionContext.o) -[DTARAIRExtensionContext dispatch:data:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARAIRExtensionContext.o) "_objc_msgSend$isSupported", referenced from: -[DTARReviewController requestReview] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARReviewController.o) _ApplicationRater_review_isSupported in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$count", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$initWithFormat:arguments:", referenced from: -[DTFBCAIRExtensionContext log:message:] in C:\Users\user\AppData\Local\Temp\a8a82946-2439-4877-81f1-91b6c53d9ec6\libcom.google.firebase.core.a(DTFBCAIRExtensionContext.o) -[DTARAIRExtensionContext log:message:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARAIRExtensionContext.o) "_objc_msgSend$sharedApplication", referenced from: -[DTARApplicationRaterController redirectToApplicationPage:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$requestReview", referenced from: -[DTARReviewController requestReview] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARReviewController.o) _ApplicationRater_review_requestReview in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$URLWithString:", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) -[DTARApplicationRaterController redirectToApplicationPage:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$objectAtIndex:", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$initWithData:encoding:", referenced from: +[DTARApplicationIDEvent formatForEvent:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationIDEvent.o) +[DTARApplicationIDEvent formatForErrorEvent:error:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationIDEvent.o) "_objc_msgSend$systemVersion", referenced from: -[DTARApplicationRaterController redirectToApplicationPage:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$dataWithJSONObject:options:error:", referenced from: +[DTARApplicationIDEvent formatForEvent:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationIDEvent.o) +[DTARApplicationIDEvent formatForErrorEvent:error:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationIDEvent.o) "_objc_msgSend$numberWithInt:", referenced from: +[DTARApplicationIDEvent formatForEvent:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationIDEvent.o) +[DTARApplicationIDEvent formatForErrorEvent:error:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationIDEvent.o) "_objc_msgSend$dataWithContentsOfURL:", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$intValue", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$presentViewController:animated:completion:", referenced from: -[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$redirectToApplicationPage:", referenced from: ___97-[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) _ApplicationRater_rateRedirect in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$objectForKey:", referenced from: -[DTARApplicationRaterController retrieveApplicationId] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) _ApplicationRater_load in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$localizedDescription", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$code", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$retrieveApplicationIdForBundleId:", referenced from: -[DTARApplicationRaterController retrieveApplicationId] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$extContext", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) ___97-[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) ___97-[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:]_block_invoke.43 in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) ___97-[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:]_block_invoke.46 in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) ___97-[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:]_block_invoke_2 in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$currentDevice", referenced from: -[DTARApplicationRaterController redirectToApplicationPage:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$JSONObjectWithData:options:error:", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$stringWithFormat:", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$setObject:forKey:", referenced from: +[DTARApplicationIDEvent formatForEvent:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationIDEvent.o) +[DTARApplicationIDEvent formatForErrorEvent:error:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationIDEvent.o) _ApplicationRater_save in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$addAction:", referenced from: -[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$class", referenced from: -[DTARReviewController isSupported] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARReviewController.o) "_objc_msgSend$actionWithTitle:style:handler:", referenced from: -[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$stringByReplacingOccurrencesOfString:withString:", referenced from: -[DTARApplicationRaterController redirectToApplicationPage:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$setContext:", referenced from: _ApplicationRaterContextInitializer in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _ApplicationRaterContextFinalizer in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _firebasecoreContextInitializer in C:\Users\user\AppData\Local\Temp\a8a82946-2439-4877-81f1-91b6c53d9ec6\libcom.google.firebase.core.a(FirebaseCore.o) _firebasecoreContextFinalizer in C:\Users\user\AppData\Local\Temp\a8a82946-2439-4877-81f1-91b6c53d9ec6\libcom.google.firebase.core.a(FirebaseCore.o) "_objc_msgSend$dispatch:data:", referenced from: ___67-[DTARApplicationRaterController retrieveApplicationIdForBundleId:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) ___97-[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:]_block_invoke in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) ___97-[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:]_block_invoke.43 in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) ___97-[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:]_block_invoke.46 in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) ___97-[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:]_block_invoke_2 in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$standardUserDefaults", referenced from: _ApplicationRater_load in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _ApplicationRater_save in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$mainBundle", referenced from: -[DTARApplicationRaterController retrieveApplicationId] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$alertControllerWithTitle:message:preferredStyle:", referenced from: -[DTARApplicationRaterController showRateDialog:title:message:rateLabel:declineLabel:laterLabel:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$openURL:", referenced from: -[DTARApplicationRaterController redirectToApplicationPage:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$setExtContext:", referenced from: -[DTARApplicationRaterController review] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) _ApplicationRaterContextInitializer in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _ApplicationRaterContextFinalizer in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$floatValue", referenced from: -[DTARApplicationRaterController redirectToApplicationPage:] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARApplicationRaterController.o) "_objc_msgSend$getRootViewController", referenced from: -[DTARAIRExtensionContext getViewController] in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(DTARAIRExtensionContext.o) "_objc_msgSend$UTF8String", referenced from: _ApplicationRaterVersion in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) "_objc_msgSend$newFREObjectFromString:", referenced from: _ApplicationRaterImplementation in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _ApplicationRater_load in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _ApplicationRater_getInstallerStore in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _firebasecore_version in C:\Users\user\AppData\Local\Temp\a8a82946-2439-4877-81f1-91b6c53d9ec6\libcom.google.firebase.core.a(FirebaseCore.o) _firebasecore_implementation in C:\Users\user\AppData\Local\Temp\a8a82946-2439-4877-81f1-91b6c53d9ec6\libcom.google.firebase.core.a(FirebaseCore.o) "_objc_msgSend$getFREObjectAsString:", referenced from: _ApplicationRater_save in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _ApplicationRater_showRateDialog in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) _ApplicationRater_rateRedirect in C:\Users\user\AppData\Local\Temp\d8dd9cd5-1caa-4d7a-af34-f0651ddd2b8f\libcom.distriqt.ApplicationRater.a(ApplicationRater.o) ld: symbol(s) not found for architecture arm64 Compilation failed while executing : ld64 ```
sebastianLIFEtool commented 1 year ago

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

ajwfrost commented 1 year ago

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....

sebastianLIFEtool commented 1 year ago

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.

marchbold commented 1 year ago

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.

ajwfrost commented 1 year ago

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

marchbold commented 1 year ago

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.

sebastianLIFEtool commented 1 year ago

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

marchbold commented 1 year ago

(Looking good for iOS frameworks too, just need to do some testing on windows as well though).

itlancer commented 1 year ago

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

ajwfrost commented 1 year ago

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

marchbold commented 1 year ago

Definitely check the compiler flag. I can confirm the compiler flag is working for us, just about completed the update to all our extensions...

itlancer commented 1 year ago

@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. image

Previously I have added -fno-objc-msgsend-selector-stubs only to "Other C++ Flags" and it didn't help.