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

Failed to package AIR application SDK 50.2.4.3

Open Tuning3DT opened this issue 1 year ago • 9 comments

Hello. Today I updated AIR SDK from 50.2.3.1 to 50.2.4.3. I managed to build and upload the IPA package however I can't package the APK file and this waring message pops up

Failed to package AIR application App.apk: Warning: packagedDependency okio-1.17.5.jar used by more than one ANE. Ignoring this entry NOTE: Multiple Android build-tools folders exist, choosing the latest version (30.0.3) for packaging JAVA_HOME does not point to a valid JDK installation, which is required for Android App Bundle signing

I installed JDK gain and set JAVA_HOME but it didn't help. There are no issues with 50.2.3.1 at all. AIR SDK: 50.2.4.3 MacOS: 12.7.2 (Monterey) Xcode: 14.2

Tuning3DT avatar Jan 26 '24 15:01 Tuning3DT

Worth checking from the ADT logging to see what version of Java it's trying to run there .. if you have the AIR SDK Manager, run the "Troubleshooting" tab and re-build, it should show you. And from the SDK Manager you can also set the JAVA_HOME variable, not sure what you have that set to but it should be the JDK installation folder then something like /Contents/Home iirc..

thanks

ajwfrost avatar Jan 26 '24 15:01 ajwfrost

Tried with Java 15, 17 and 21. all returned the same err.

Warning: packagedDependency okio-1.17.5.jar used by more than one ANE. Ignoring this entry Warning: 
packagedDependency jsr305-3.0.2.jar used by more than one ANE. Ignoring this entry unexpected failure: 
Cannot invoke "org.w3c.dom.Node.getNodeValue()" because " " is null java.lang.NullPointerException: 
Cannot invoke "org.w3c.dom.Node.getNodeValue()" because " " is null at 
com.adobe.air.apk.AABOutputStream.editAndroidManifest(AABOutputStream.java) at 
com.adobe.air.apk.AABOutputStream.createAndroidManifestXml(AABOutputStream.java) at 
com.adobe.air.apk.AABOutputStream.generateResourcesAndManifest(AABOutputStream.java) at 
com.adobe.air.apk.AABOutputStream.addApplicationDescriptor(AABOutputStream.java) at 
com.adobe.air.ApplicationPackager.addSpecialFiles(ApplicationPackager.java) at 
com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java) at 
com.adobe.air.apk.AABPackager.createPackage(AABPackager.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)

myflashlab avatar Jan 28 '24 09:01 myflashlab

AIRSDKMANAGER logs:

ADT 50.2.4.3 called with: -version

ADT 50.2.4.3 called with: 
-package -target apk-debug -listen 7936 -arch armv8 -storetype PKCS12 
-keystore /.../app/cert/android.keystore -storepass xxxxxx 
/.../app/out/xxx.apk 
/.../app/out/application.xml 
-extdir /.../app/ane 
-C /.../app/out Main.swf 
-C /.../app/assets icons 
-C /.../app res 
-C /.../app/assets img 
-C /.../app/workers worker.swf 

Target requested was apk-debug, but not using legacy APK so building via Android Studio

Creating device SDK handler - location passed in = /Users/hadi/Library/Android/sdk

Adding gradle dependency: implementation 'com.google.code.gson:gson:2.8.9'

Unexpected failure: Cannot invoke "org.w3c.dom.Node.getNodeValue()" because "<local36>" is null

myflashlab avatar Jan 28 '24 09:01 myflashlab

@ajwfrost I could package an APK for a couple of times, and then it just started failing again.

Warning: packagedDependency okio-1.17.5.jar used by more than one ANE. Ignoring this entry NOTE: Multiple Android build-tools folders exist, choosing the latest version (30.0.3) for packaging unexpected failure: Unable to run java: com.adobe.air.ADTException: gradle tool failed: FAILURE: Build failed with an exception. What went wrong: A problem occurred configuring project ':app'. > Could not open cp_proj generic class cache for build file '/private/var/folders/9q/j1t5tgq17l31p6hvtzvkkjlc0000gn/T/509a82a7-f12e-43e8-bfcd-94b6b43b5890/app/build.gradle' (/Users/vardan/.gradle/caches/7.5/scripts/3q88kletlsrsz69uuqhj92qi7). > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65 Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. Get more help at https://help.gradle.org BUILD FAILED in 1m 59s java.io.IOException: Unable to run java: com.adobe.air.ADTException: gradle tool failed: FAILURE: Build failed with an exception. What went wrong: A problem occurred configuring project ':app'. > Could not open cp_proj generic class cache for build file '/private/var/folders/9q/j1t5tgq17l31p6hvtzvkkjlc0000gn/T/509a82a7-f12e-43e8-bfcd-94b6b43b5890/app/build.gradle' (/Users/vardan/.gradle/caches/7.5/scripts/3q88kletlsrsz69uuqhj92qi7). > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65 Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. Get more help at https://help.gradle.org BUILD FAILED in 1m 59s at com.adobe.air.apk.AABOutputStream.buildGradle(AABOutputStream.java) at com.adobe.air.apk.AABPackager.renameOutput(AABPackager.java) at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java) at com.adobe.air.apk.AABPackager.createPackage(AABPackager.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)

ADT logging /Applications/IntelliJ IDEA.app/Contents/jbr/Contents/Home/bin/java -Dapplication.home=/Users/vardan/projs/airsdk/AIRSDK_MacOS 50.2.4.3 -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Duser.language=en -Duser.region=en -Xmx512m -jar /Users/vardan/projs/airsdk/AIRSDK_MacOS 50.2.4.3/lib/adt.jar -package -target apk -arch armv8 -storetype PKCS12 -keystore /Users/vardan/projs/tuningAppAs/Certs/Android/upload_key/upload_certificate.p12 -storepass 123456 /Users/vardan/projs/tuningAppAs/bin/AppName.apk /Users/vardan/projs/tuningAppAs/bin/AppName-app.xml -extdir /Users/vardan/projs/tuningAppAs/libs/Ads -extdir /Users/vardan/projs/tuningAppAs/libs/distriqt -extdir /Users/vardan/projs/tuningAppAs/libs/playServices -extdir /Users/vardan/projs/tuningAppAs/libs/AndroidX -extdir /Users/vardan/projs/tuningAppAs/libs/ApplicationData -extdir /Users/vardan/projs/tuningAppAs/libs/Facebook -extdir /Users/vardan/projs/tuningAppAs/libs/inAppPurchase -extdir /Users/vardan/projs/tuningAppAs/libs/Firebase -extdir /Users/vardan/projs/tuningAppAs/libs/square -extdir /Users/vardan/projs/tuningAppAs/libs/Share -extdir /Users/vardan/projs/tuningAppAs/libs/AppleSignIn -extdir /Users/vardan/projs/tuningAppAs/libs/WebView -extdir /Users/vardan/projs/tuningAppAs/libs/applicationRater -extdir /Users/vardan/projs/tuningAppAs/libs/gameServices -extdir /Users/vardan/projs/tuningAppAs/libs/CameraRoll -extdir /Users/vardan/projs/tuningAppAs/libs/vibration -extdir /Users/vardan/projs/tuningAppAs/libs/media -C /Users/vardan/projs/tuningAppAs/bin AppName.swf -C /Users/vardan/projs/tuningAppAs/src .

Tuning3DT avatar Jan 30 '24 14:01 Tuning3DT

Hi

It seems that it's trying to use a tool that is designed for too late a version of Java...

Unsupported class file major version 65

I'm not actually sure what the tool is...

BUG! exception in phase 'semantic analysis' in source unit 'BuildScript'

but it looks like you will need to use Java 21 for this, which supported class file major version number 65.

thanks

ajwfrost avatar Jan 30 '24 18:01 ajwfrost

@ajwfrost thanks for replying. That's strange, because I'm actually using java 21. Sometimes I try packaging and it goes without any errors with exactly the same settings and successfully packages the APK. Looks like some cache. I tried invalidating the IDE cache multiple times but It didn't work. There are no issues with the SDK 50.2.3.1. image

Tuning3DT avatar Jan 31 '24 07:01 Tuning3DT

Strange, I tried upgrading to air 50.2.4.3 on windows and am also getting this:

unexpected failure: Cannot invoke "org.w3c.dom.Node.getNodeValue()" because "<local36>" is null
java.lang.NullPointerException: Cannot invoke "org.w3c.dom.Node.getNodeValue()" because "<local36>" is null

I've tried JDK 21 but it didn't help.

@Tuning3DT are you also using FlashDevelop on Windows? I'm wondering why this is happening to us but I haven't seen it reported by others yet.

Devin-Licastro avatar Feb 07 '24 03:02 Devin-Licastro

Hi @Devin-Licastro - I'm wondering whether that's the same root cause as #3036 If you can check your application descriptor manifestAdditions section to see if you have anything like:

<uses-feature android:name="android.hardware.camera" />

could you please explicitly include the 'required' value, i.e:

<uses-feature android:name="android.hardware.camera" android:required="true" />

thanks

ajwfrost avatar Feb 07 '24 10:02 ajwfrost

Hey Andrew,

I did indeed have: <uses-feature android:name="android.hardware.camera" />

I've updated it to: <uses-feature android:name="android.hardware.camera" android:required="true" />

and so far so good... however it's hard to 100% confirm the fix because as Tuning mentioned it sometimes compiles fine on the newer air (seeming to be caching related.) But I'll let you know if I see the issue again.

Ender22 avatar Feb 07 '24 11:02 Ender22