airsdk / Adobe-Runtime-Support

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

[macOS] iOS IPA packaging Java error #1090

Open itlancer opened 3 years ago

itlancer commented 3 years ago

Problem Description

iOS IPA packaging Java error happens with macOS via Terminal.

Tested with latest AIR SDK 33.1.1.575 and AIR application without native extensions (native code) with macOS Big Sur 11.3.1 (20E241) and Intel-based MacBook Pro. The same packaging command for the same iOS application works fine with Windows.

JAVA_HOME variable:

username@MacBook-Pro-Laptop Player % echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home

Java version:

username@MacBook-Pro-Laptop Player % java -version
java version "15.0.2" 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)

Related issues (but they closed without solution): https://github.com/airsdk/Adobe-Runtime-Support/issues/832 https://github.com/airsdk/Adobe-Runtime-Support/issues/799

Steps to Reproduce

Try to package iOS IPA application using macOS Terminal command: /Users/username/Documents/SDK/AIRSDK_MacOS_33_1_1_575/bin/adt -package -target ipa-ad-hoc -storetype pkcs12 -keystore certificate.p12 -storepass password -keypass password -provisioning-profile profile.mobileprovision MyApp.ipa descriptor.xml -extdir libs MyApp.swf icons Assets.car LaunchScreen.storyboardc purposeStrings.xml

Actual Result: Packaging failed with error:

Exception in thread "main" java.lang.NoSuchMethodError: 'sun.security.util.ObjectIdentifier sun.security.util.ObjectIdentifier.newInternal(int[])'
    at com.adobe.air.ipa.MachoSigner.signToStream(MachoSigner.java)
    at com.adobe.air.ipa.MachoSigner.newCMSBlob(MachoSigner.java)
    at com.adobe.air.ipa.MachoSigner.sign(MachoSigner.java)
    at com.adobe.air.ipa.MachoSigner.sign(MachoSigner.java)
    at com.adobe.air.ipa.IPASigner.signMacho(IPASigner.java)
    at com.adobe.air.ipa.IPAOutputStream.finalizeSig(IPAOutputStream.java)
    at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java)
    at com.adobe.air.ipa.IPAPackager.createPackage(IPAPackager.java)
    at com.adobe.air.ADT.parseArgsAndGo(ADT.java)
    at com.adobe.air.ADT.run(ADT.java)
    at com.adobe.air.ADT.main(ADT.java)

Expected Result: iOS IPA application will be packaged successfully.

Known Workarounds

Add to AIRSDK/lib/adt.cfg file line: UseNativeCodesign=true or use Windows for packaging iOS IPA

ajwfrost commented 3 years ago

Hi - as a potential workaround, can you try setting the ‘UseNativeCodesign’ configuration setting to true in adt.cfg? This will try to avoid using any of the internal sun security classes. The SDK is meant to work this out for itself, but it seems we missed a condition..

thanks

itlancer commented 3 years ago

@ajwfrost, adding UseNativeCodesign=true did the trick. Mentioned it as workaround. Thanks! Hope it will be fixed properly with new AIR releases.