Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

ipa build on WinPC fails.

Open takazawa-gg opened this issue 2 years ago • 2 comments

Hi.

I have created an ANE for advertising and am using it in my app. After updating an AdNetwork SDK, ipa builds now fail on Win10 PCs.

ld: file is universal (4 slices) but does not contain the arm64 architecture: XXXXX.framework/XXXXX for architecture arm64
Compilation failed while executing : ld64

Building on a Mac using the same ANE will succeed.

If you check the target file with lipo, it looks like arm64 is included.

> lipo -i XXXXX.framework/XXXXX
Architectures in the fat file: XXXXX.framework/XXXXX are: armv7 i386 x86_64 arm64

> file XXXXX.framework/XXXXX
XXXXX.framework/XXXXX: Mach-O universal binary with 4 architectures: [arm_v7:current ar archivecurrent ar archive] [i386:current ar archivecurrent ar archive] [x86_64] [arm64]

Whether ANE was built on a Mac or WinPC, the results were the same.

We have multiple members developing apps using Win PC, so forcing everyone to build on a Mac is inefficient.

Is there any workaround? I'm not sure, but can copying ld64 from somewhere on my Mac to WinPC fix the problem?

Environment

  • WinPC Windows 10 Pro (21H2) AIR SDK (Win) 33.1.1.856 / 33.1.1.889

  • Mac macOS Monterey 12.4 Xcode 13.4 (13F17a) AIR SDK (Mac) 33.1.1.856 / 33.1.1.889

thanks

takazawa-gg avatar Jun 16 '22 08:06 takazawa-gg

Hi

Can you just check the output of the ANE using the Windows version of lipo please? [AIR SDK folder]\lib\aot\bin\lipo\lipo.exe

There are perhaps two possibilities here: a) the input framework file has been modified by the build process prior to it being passed to ld b) the ld process is not able to cope with some new formats that may be in the framework library

To try to work this out:

After updating an AdNetwork SDK

Is the update here something where the build tools for it have changed, or just a code/dependency update? is it possible to build the new ANE using an older toolchain, or build the older one using a new toolchain, to try to isolate what change has caused the problem?


can copying ld64 from somewhere on my Mac to WinPC fix the problem?

The ld64 process on Windows is a rebuild of the macOS one, using Apple's source code, but it's somewhat out-dated now. We've not changed it, we're using what we got from Adobe, so it may be that we need to look at creating a new version of this....

thanks

ajwfrost avatar Jun 16 '22 10:06 ajwfrost

Thank you for your reply.

Can you just check the output of the ANE using the Windows version of lipo please?

I checked it with the windows version 33.1.1.889. "Arm64" was displayed for all patterns. A little unexpected?

  • Before ANE packaging: Old version
> lipo.exe -i XXXXX.framework\XXXXX
DATA addr 02A90000
Architectures in the fat file: XXXXX.framework\XXXXX are: armv7 i386 x86_64 arm64
  • Before ANE packaging: New version
> lipo.exe -i XXXXX.framework\XXXXX
DATA addr 02A40000
Architectures in the fat file: XXXXX.framework\XXXXX are: armv7 i386 x86_64 arm64
  • After ANE packaging: Old version
> lipo.exe -i <ANE NAME>\META-INF\ANE\iPhone-ARM\XXXXX.framework\XXXXX
DATA addr 02AD0000
Architectures in the fat file: <ANE NAME>\META-INF\ANE\iPhone-ARM\XXXXX.framework\XXXXX are: armv7 i386 x86_64 arm64
  • After ANE packaging: New version
> lipo.exe -i <ANE NAME>\META-INF\ANE\iPhone-ARM\XXXXX.framework\XXXXX
DATA addr 02A30000
Architectures in the fat file: <ANE NAME>\META-INF\ANE\iPhone-ARM\XXXXX.framework\XXXXX are: armv7 i386 x86_64 arm64

Is the update here something where the build tools for it have changed, or just a code/dependency update?

Specifically, I was creating an ANE for AppLovin Max, and this time I updated the Pangle (Ad Network) adapter and Pangle SDK (* .framework).

Below is the SDK file.

  • The newer one. This causes problems. https://sf16-fe-tos-sg.i18n-pglstatp.com/obj/pangle-sdk-static-va/4.5.1.3/SDK.zip SDK/BUAdSDK.framework/Versions/A/BUAdSDK

  • Conventional one. I was able to build without problems. https://sf16-fe-tos-sg.i18n-pglstatp.com/obj/pangle-sdk-static-va/4.0.0.5/PangleSDK.zip PangleSDK/BUAdSDK.framework/Versions/A/BUAdSDK

The changes this time are the replacement of the .framework containing the BUAdSDK file above and the addition of some additional dependent .framework.

The composition of ANE has not changed significantly. The AIR SDKs I used were all 33.1.1856, and I later tried 33.1.1.889.

I don't know if it makes sense, but I used lipo -extract on my Mac to make the BUAdSDK only armv7, arm64, but it didn't change.

The root cause may be a change in the way Pangle's BUAdSDK is created, but I don't know exactly what's wrong, so I don't know what to get Pangle to support.

Please let me know if you have anything else you would like to try.

thanks

takazawa-gg avatar Jun 17 '22 02:06 takazawa-gg