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

Xcode 15 build issue: unknown option sdk_version #2838

Open marchbold opened 1 year ago

marchbold commented 1 year ago

Problem Description

Xcode 15 causes a build issue. Packaging an application results in an error:

ld: unknown options: -sdk_version

Describe your problem in detail. Include the following information:

Steps to Reproduce

Update Xcode to v15 and attempt to package an application for iOS

Known Workarounds

Downgrade to Xcode 14

ajwfrost commented 1 year ago

This is one where actually, specifying a platform SDK will avoid it .. but yes we are going to update that linker command line, will get this into our next release.

thanks

mattdaboy commented 1 year ago

Hi Andrew, Yes it solves the problem but another comes along. When ipa file is verified in Transporter app, it throws this message : Asset validation failed (90725). SDK version issue. This app was built with the iOS 12.0 SDK. All iOS and iPadOS apps submitted to the App Store must be built with the iOS 16.1 SDK or later, included in Xcode 14.1 or later. I use Xcode 15.0 and Transporter 1.2.5, both latest versions. I have a M1 MacBook. I solved the problem by using an old Intel based iMac with an older version of Xcode as well, but it's not convenient in my packaging workflow. Best regards.

ajwfrost commented 1 year ago

@mattdaboy - that's odd if you're using a recent AIR SDK, it should be setting the ios sdk version to 16.4... are you able to check the ld64 command line (via AIR SDK Manager)?

mattdaboy commented 1 year ago

Andrew, I don't use AIR SDK Manager, I take the whole ZIP on the Harman website. Version used : 50.2.3.5

ajwfrost commented 1 year ago

You can get the command line from the "adt.log" file then .. if you edit ~/.airsdk/adt.cfg to add a line DebugOut=true and then run it, it should generate ~/adt.log which would have the full ld64 command line..

thanks

mattdaboy commented 1 year ago

Hi Andrew, Here is the command line :

ld64 command line: /usr/bin/ld -pie -ObjC -dead_strip -Z -arch arm64 -L"/Library/AIRSDK_50.2.3.5/lib/aot/stub" -sdk_version 16.4 -F"/Library/AIRSDK_50.2.3.5/lib/aot/stub" -L"/Library/AIRSDK_50.2.3.5/lib/aot/lib" -o "../aot14898666271911579745.tmp" -x "/Library/AIRSDK_50.2.3.5/lib/aot/lib/libRuntimeHMAOT.arm-air.a" -lc++ -lSystem.B -lz -lobjc -lclang_rt.ios -framework CoreFoundation -framework UIKit -framework MobileCoreServices -framework CoreGraphics -framework Foundation -framework SystemConfiguration -framework AudioToolbox -framework CFNetwork -framework QuartzCore -framework OpenGLES -framework CoreLocation -framework CoreMedia -framework CoreVideo -framework AVFoundation -framework Security -framework GameController -framework CoreMotion -framework AssetsLibrary -framework WebKit -liconv -weak_framework CoreVideo -weak_framework CoreMedia -weak_framework AVFoundation -w -lclang_rt.ios -ObjC -weak_framework UserNotifications -w "-F/var/folders/9l/gy3blr9j6l364jtzdqqyy8dw0000gn/T/2bfaf59a-4d71-484b-8706-48e461a8c7bf" -framework "CoreNativeExtension" -weak_framework Photos -w -framework MessageUI -framework Accounts -framework Social -framework ImageIO -w -framework CoreTelephony -w -filelist "/Users/matthieu/Dev/App/Opendo_12.22_sondage-modeles/Anim/bin/AOTBuildOutput11259251171125067297.tmp/OBJFilesList.txt" -ios_version_min 12.0 -exported_symbols_list "/Users/matthieu/Dev/App/Opendo_12.22_sondage-modeles/Anim/bin/AOTBuildOutput11259251171125067297.tmp/SYMFilesList.txt" ld: unknown options: -sdk_version

..java.base/java.lang.Thread.getStackTrace(Thread.java:1606) ..com.adobe.air.DebugFile.printStack(DebugFile.java) ..com.adobe.air.InvalidInputException.(InvalidInputException.java) ..com.adobe.air.ipa.AOTCompiler.generateMachineBinaries(AOTCompiler.java) ..com.adobe.air.ipa.IPAOutputStream.createIosBinary(IPAOutputStream.java) ..com.adobe.air.ipa.IPAOutputStream.access$100(IPAOutputStream.java) ..com.adobe.air.ipa.IPAOutputStream$CompileTask.run(IPAOutputStream.java) ..java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ..java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ..java.base/java.lang.Thread.run(Thread.java:834) Stack trace: ..java.base/java.lang.Thread.getStackTrace(Thread.java:1606) ..com.adobe.air.DebugFile.printStack(DebugFile.java) ..com.adobe.air.InvalidInputException.(InvalidInputException.java) ..com.adobe.air.ipa.IPAOutputStream$CompileTask.throwAppropriateException(IPAOutputStream.java) ..com.adobe.air.ipa.IPAOutputStream.finalizeSig(IPAOutputStream.java) ..com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java) ..com.adobe.air.ipa.IPAPackager.createPackage(IPAPackager.java) ..com.adobe.air.ADT.parseArgsAndGo(ADT.java) ..com.adobe.air.ADT.run(ADT.java) ..com.adobe.air.ADT.main(ADT.java) Stack trace: Invalid input: Compilation failed while executing : ld64

ajwfrost commented 1 year ago

Thanks .. but presumably this one isn't using the platformsdk command?

We have two scenarios: 1) not using platformsdk - results in a linker error with unknown sdk_version value 2) using platformsdk - links okay but Apple say it's built with 12.0

If you're able to re-build with the platform sdk and let us know the ld64 command line for that one, it should (hopefully!) then be clear where Apple get this idea of it being built with SDK 12.0...

thanks

mattdaboy commented 1 year ago

With platformsdk, it seems that -sdk_version is not present :

ld64 command line: /usr/bin/ld -pie -ObjC -dead_strip -Z -arch arm64 -syslibroot "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk" -L/usr/lib -F"/System/Library/Frameworks" -L"/Library/AIRSDK_50.2.3.5/lib/aot/lib" -o "../aot4301154517627047578.tmp" -x "/Library/AIRSDK_50.2.3.5/lib/aot/lib/libRuntimeHMAOT.arm-air.a" -lc++ -lSystem.B -lz -lobjc -lclang_rt.ios -framework CoreFoundation -framework UIKit -framework MobileCoreServices -framework CoreGraphics -framework Foundation -framework SystemConfiguration -framework AudioToolbox -framework CFNetwork -framework QuartzCore -framework OpenGLES -framework CoreLocation -framework CoreMedia -framework CoreVideo -framework AVFoundation -framework Security -framework GameController -framework CoreMotion -framework AssetsLibrary -framework WebKit -liconv -weak_framework CoreVideo -weak_framework CoreMedia -weak_framework AVFoundation -w -lclang_rt.ios -ObjC -weak_framework UserNotifications -w "-F/var/folders/9l/gy3blr9j6l364jtzdqqyy8dw0000gn/T/bb62e3f7-8087-4560-a13a-0caf84909318" -framework "CoreNativeExtension" -weak_framework Photos -w -framework MessageUI -framework Accounts -framework Social -framework ImageIO -w -framework CoreTelephony -w -filelist "/Users/matthieu/Dev/App/Opendo_12.22_sondage-modeles/Anim/bin/AOTBuildOutput14322556635279963616.tmp/OBJFilesList.txt" -ios_version_min 12.0 -exported_symbols_list "/Users/matthieu/Dev/App/Opendo_12.22_sondage-modeles/Anim/bin/AOTBuildOutput14322556635279963616.tmp/SYMFilesList.txt"

ajwfrost commented 1 year ago

Thanks - so this hasn't set the SDK version number, it's got a "minimum" value of 12.0 but otherwise is built using the latest Xcode and with iPhone OS 17.0 SDK.

Can you find the output .ipa file and unzip it, there's a "Payload/appname.app" folder within which should be a binary file called "appname". Can you please run otool -l appname | grep sdk and see what it outputs?

thanks

mattdaboy commented 1 year ago

sdk 12.0

ajwfrost commented 1 year ago

Okay interesting .. we may need to revise the linker arguments here... let me check and get back to you..

pirrest commented 1 year ago

Hello! The same issue here. And I can't downgrade to XCode 14 because it can't be launched on MacOS Sonoma 14 :(

ajwfrost commented 1 year ago

Hi @pirrest (and @mattdaboy) - please use the latest AIR SDK release, 50.2.3.6, and include a setting/command-line option for the platform SDK (pointing to the iPhoneOS 17.0 SDK). With the latest AIR SDK release, this will use the native/built-in Apple linker from Xcode 15, along with the iPhoneOS SDK (rather than our stubs), and now it will also set up the build information as showing that it's built using Xcode 14 and iPhoneOS 16.4 SDK.

Note that there's an issue with the Xcode 15 linker trying to link against our stub files. We may need to go back to a separate linker (in conjunction with the changes that we need to make anyway to the linker on Windows..) - but in the meantime, please just use the -platformsdk command-line option on macOS.

thanks

wmtj commented 1 year ago

Hi @pirrest (and @mattdaboy) - please use the latest AIR SDK release, 50.2.3.6, and include a setting/command-line option for the platform SDK (pointing to the iPhoneOS 17.0 SDK). With the latest AIR SDK release, this will use the native/built-in Apple linker from Xcode 15, along with the iPhoneOS SDK (rather than our stubs), and now it will also set up the build information as showing that it's built using Xcode 14 and iPhoneOS 16.4 SDK.

Note that there's an issue with the Xcode 15 linker trying to link against our stub files. We may need to go back to a separate linker (in conjunction with the changes that we need to make anyway to the linker on Windows..) - but in the meantime, please just use the -platformsdk command-line option on macOS.

thanks

AIR SDK(50.2.3.6), Windows 11, FlashBuilder 4.7

In development mode, the following error is displayed: Warning:ipa-app-store build but provisioning profile does not hava beta-reports-active entitilement.

In distribution mode, the following error is displayed: Id:unknown option:-platform_version Compilation failed while executing : Id64

@ajwfrost

ajwfrost commented 1 year ago

Ah -> we'd pushed that update out (to ADT plus iOS) focusing on just the macOS side of things .. so in order to fix this for Windows too, you'd need the updated linker files mentioned in the below comment: https://github.com/distriqt/ANE-GooglePlayServices/issues/28#issuecomment-1744230616

jdtapslots commented 1 year ago

We also get the error whilst building on Windows with 50.2.3.6:

     [java] [Adt]ld: unknown option: -platform_version
     [java] [Adt]
     [java] [AdtE]Compilation failed while executing : ld64

Tried replacing the ld64 folder and now get the following errors:

     [java] [Adt]ld64: error: duplicate symbol: l016
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l023
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l022
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l021
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l020
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l019
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l004
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l005
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l006
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l007
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l008
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l009
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l010
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l011
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l012
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l013
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [AdtE]Compilation failed while executing : ld64
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l014
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l015
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l024
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: l017
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFURL.o)
     [java] [Adt]>>> defined in E:\\tmp\\84d5befd-074b-4d2f-bc7d-8cf4ed2600b8\Bolts.framework\Bolts(BFTaskCompletionSource.o)
     [java] [Adt]
     [java] [Adt]ld64: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
     [java] [Adt]
     [java] Exit: 12
     [java] Package Failed
ajwfrost commented 1 year ago

Hi @jdtapslots - what ANE are you using that has this Bolts framework in it? It would be good if we can reproduce this..

This appears to be the following issue: https://github.com/llvm/llvm-project/issues/55893 which means that the framework has got duplicate symbols and this isn't actually valid, even though the Apple linker would be ignoring the duplication as it may not have bothered loading the second .o file.

The ideal solution would be to remove the duplicate symbols from the framework. A potential option might be for us to try to see what the Apple linker does with this, and then see if we can replicate that within the LLVM linker .. which would mean, we have to make the assumption that everything that's passed to the ADT tool is "correct"!

thanks

marchbold commented 1 year ago

Going to guess it's this one: https://github.com/distriqt/ANE-Bolts

Weird we've never seen this issue before though, I actually think it's not used by many developers anymore, not sure Facebook even still use it.

ajwfrost commented 1 year ago

Thanks, let me check it here...

jdtapslots commented 1 year ago

I couldn't see bolts referenced directly anywhere, so removed the extension and now get:

[java] [Adt]ld64: error: undefined symbol: _OBJC_CLASS_$_BFURL
     [java] [Adt]>>> referenced by /Users/marchbold/work/distriqt/extensions/extensions/facebookapi/source/extensions/core/platform/ios\/Users/marchbold/work/distriqt/extensions/extensions/facebookapi/source/extensions/core/platform/ios/FacebookCore/controller/applinks/DTFBSDKCAppLinks.m
     [java] [Adt]>>>               E:\tmp\73c96112-177d-488f-bb0e-a88265b76e72\libcom.distriqt.facebook.Core.a(DTFBSDKCAppLinks.o):(symbol _OBJC_CLASSLIST_REFERENCES_$_.27+0x0)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: _ga_getProgressionStatus
     [java] [Adt]>>> defined in AddProgressionEventWithScoreFunction.m:6 (GameAnalytics/Functions\AddProgressionEventWithScoreFunction.m:6)
     [java] [Adt]>>>            E:\tmp\a7442b2a-7131-44bb-8395-19add84d50bf\libcom.gameanalytics.sdk.a(AddProgressionEventWithScoreFunction.o)
     [java] [Adt]>>> defined in AddProgressionEventFunction.m:6 (GameAnalytics/Functions\AddProgressionEventFunction.m:6)
     [java] [Adt]>>>            E:\tmp\a7442b2a-7131-44bb-8395-19add84d50bf\libcom.gameanalytics.sdk.a(AddProgressionEventFunction.o)
     [java] [Adt]
     [java] [Adt]ld64: error: duplicate symbol: _distriqt_core_ctx
     [java] [Adt]>>> defined in FirebaseCore.m:30 (FirebaseCore\FirebaseCore.m:30)
     [java] [Adt]>>>            E:\tmp\967d2eea-2d91-4e77-a510-4cd3fcc37b94\libcom.google.firebase.core.a(FirebaseCore.o)
.... and more

Hope this helps.

ajwfrost commented 1 year ago

Thanks -> which means that 1) undefined symbol -> this is likely why you needed that Bolts ANE... 2) duplicate symbol -> means this is a more wide-ranging problem than just in the Bolts library..

We'll work on it...

thanks

mattdaboy commented 1 year ago

Hi Andrew, With latest SDK and Xcode platform SDK (pointing to the iPhoneOS 17.0 SDK), it works perfectly and it is granted by Transporter app. Thank you !

marchbold commented 1 year ago

@jdtapslots That duplicate symbol from the distriqt_core_ctx reference should be resolved if you update to the latest google play services extensions.