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

could not find Javac and/or Android SDK hence falling back to legacy build #2805

Closed shaymolho closed 1 year ago

shaymolho commented 1 year ago

happens on windows

adt.log: https://gist.github.com/shaymolho/9b724b564b2d6d57f3bd1c592f1efcd3

when running the command directly on cmd it's ok this error happens only when running on jenkins. adt.cfg: https://gist.github.com/shaymolho/5d8a7f12ee1586a853d7dd41fe3d5de5 any idea?

ajwfrost commented 1 year ago

The platform SDK should be the top level folder, we then look under it to pick up build tools etc:

AndroidPlatformSDK=C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk

thanks

shaymolho commented 1 year ago

still happens:

https://gist.github.com/shaymolho/1b3337e023fe7f9fb573c4b6e8366ec7 I suspect jenkins doesn't read this cfg file? any troubleshooting i can try?

ajwfrost commented 1 year ago

ADT should try to read the file but it perhaps depends on how the Jenkins process is running (i.e. under what username). Maybe search the whole machine to see if there are multiple instances of this - or just check under c:\users\ to see what usernames are present, and whether there's a .airsdk\adt.lic file under one/more of those..?

Of course, we'd also need to have read-access to that platform SDK location, so I'm hoping Jenkins is running as the Adminstrator account, and then the adt.cfg file should be in c:\users\administrator.airsdk\ ...

thanks

shaymolho commented 1 year ago

jenkins runs from a service as a local system there is only .airsdk folder under C:\users\administrator what else can be checked?

shaymolho commented 1 year ago

@ajwfrost any advice?

ajwfrost commented 1 year ago

We're preparing a build of adt.jar that gives a bit more information out about this and about how it picks up the configuration settings. You're getting a log file output I guess so something must be working in the configuration files! but also it's worth seeing if you get output in the Troubleshooting pane of the AIR SDK Manager, if you have that running on the same computer..

Will upload a new ADT build later on today..

thanks

shaymolho commented 1 year ago

the log is only from air sdk manager troubleshooting pane, adt.log is not written if run from jenkins

shaymolho commented 1 year ago

btw, i hope u manage to keep track of all the adt.jar that u send in github tickets, as they need to eventually go in the official release

ajwfrost commented 1 year ago

Yes, for sure :-) Can you please try with this one and see what extra output it gives?

thanks adt.zip

shaymolho commented 1 year ago

this is the log :

ADT 50.2.3.4 called with: -version

ADT 50.2.3.4 called with: -package -target apk-captive-runtime -arch armv8 -keystore D:\Jenkins\jobs\slotagram-build-designers\workspace\webapp\flex\slotagram-mobile-boot2/config/release.keystore -storetype JKS -providerName SUN -storepass xxxxxx -alias slotamobilekey -keypass slotalovemobile buddies-mobile-boot.apk slotagram-mobile-boot-app-android.xml slotagram-mobile.swf -C D:\Jenkins\jobs\slotagram-build-designers\workspace\webapp\flex\slotagram-mobile-boot2/target-mobile-android assets -C D:\Jenkins\jobs\slotagram-build-designers\workspace\webapp\flex\slotagram-mobile-boot2/src/main/resources/buddies/root_android . -extdir .

Ensuring we have SDK 11 and an Android SDK path

Request for a Java home folder: JDK = true, min version 11

Value of java.home system property: C:/Program Files/Eclipse Adoptium/jdk-11.0.16.101-hotspot

java -version => javac 11.0.16.1

Found version 11

Android SDK path from USR config: missing

Android SDK path from SDK config: missing

Android SDK path platform default installation: C:\Windows\system32\config\systemprofile/AppData/Local/Android/Sdk

Android SDK location not found.

Java home = C:/Program Files/Eclipse Adoptium/jdk-11.0.16.101-hotspot Android SDK = null Not requested a legacy APK build, but could not find Javac and/or Android SDK hence falling back to legacy build

Android SDK path from USR config: missing

Android SDK path from SDK config: missing

Android SDK path platform default installation: C:\Windows\system32\config\systemprofile/AppData/Local/Android/Sdk

Android SDK location not found.

Warning: Using default implementation for native extension 'com.applovin.air.mediation.facebook.corekit'

Warning: Using default implementation for native extension 'com.distriqt.WindowsStore'

AAPT command line: C:\flash_air_sdk_50\lib\android\bin\aapt.exe package -z -u -J C:\Windows\Temp\c6b64f52-7e09-4ebb-a324-deb3f5346d69 -M C:\Windows\Temp\c6b64f52-7e09-4ebb-a324-deb3f5346d69\AndroidManifest.xml -S customres -S C:\Windows\Temp\c6b64f52-7e09-4ebb-a324-deb3f5346d69\app_entry_res -S C:\Windows\Temp\c6b64f52-7e09-4ebb-a324-deb3f5346d69\captive_runtime_res -m --extra-packages com.distriqt.extension.bolts:com.google.firebase:androidx.appcompat:androidx.appcompat.resources:com.applovin.sdk:com.distriqt.extension.application:com.google.android.play.core:com.distriqt.extension.vibration:androidx.browser:com.distriqt.extension.share:androidx.constraintlayout.widget:com.facebook.login:com.bumptech.glide:androidx.cardview:com.distriqt.extension.pushnotifications:com.ironsource.sdk:com.mintegral.interactiveads.sdk:com.mintegral.interstitial.sdk:com.mintegral.mbbanner.sdk:com.mintegral.mbjscommon.sdk:com.mintegral.playercommon.sdk:com.mintegral.reward.sdk:com.mintegral.same.sdk:com.mintegral.videocommon.sdk:com.mintegral.videojs.sdk:com.facebook.common:com.samsung.android.sdk.iap.lib:com.google.android.gms.ads.impl:com.google.android.gms.ads:androidx.emoji2:androidx.emoji2.widget:androidx.emoji2.viewsintegration:androidx.activity:androidx.coordinatorlayout:androidx.core:androidx.drawerlayout:androidx.fragment:androidx.lifecycle.runtime:androidx.lifecycle.viewmodel:androidx.media:androidx.savedstate:androidx.startup:androidx.viewpager2:com.google.android.gms.base:com.google.android.gms.common: -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\distriqt-extension-bolts-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\firebase-common-20.3.3-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\appcompat-1.6.1-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\appcompat-resources-1.6.1-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\applovin-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\distriqt-extension-application-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\core-1.10.3-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\distriqt-extension-vibration-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\browser-1.5.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\distriqt-extension-share-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\constraintlayout-2.1.4-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\facebook-login-16.0.1-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\glide-4.12.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\cardview-1.0.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\distriqt-extension-pushnotifications-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\ironsource-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\mintegral-interactiveads-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\mintegral-interstitial-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\mintegral-mbbanner-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\mintegral-mbjscommon-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\mintegral-playercommon-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\mintegral-reward-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\mintegral-same-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\mintegral-videocommon-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\mintegral-videojs-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\facebook-common-16.0.1-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\IAP6Helper-release-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\play-services-ads-22.2.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\play-services-ads-lite-22.2.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\emoji2-1.3.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\emoji2-views-1.3.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\emoji2-views-helper-1.3.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\activity-1.7.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\coordinatorlayout-1.2.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\core-1.9.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\drawerlayout-1.2.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\fragment-1.5.6-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\lifecycle-runtime-2.6.1-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\lifecycle-viewmodel-2.6.1-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\media-1.6.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\savedstate-1.2.1-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\startup-runtime-1.1.1-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\viewpager2-1.0.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\play-services-base-18.2.0-res -S C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\play-services-basement-18.1.0-res --auto-add-overlay -I C:\flash_air_sdk_50\lib\android\lib\resources\android-res.jar --no-version-vectors --min-sdk-version 21 --target-sdk-version 33 --version-code 15203004 --version-name 15.203.4 -F C:\Windows\Temp\c6b64f52-7e09-4ebb-a324-deb3f5346d69\resources.apk

..java.base/java.lang.Thread.getStackTrace(Thread.java:1602)

..com.adobe.air.DebugFile.printStack(DebugFile.java)

..com.adobe.air.ADTException.(ADTException.java)

..com.adobe.air.apk.APKOutputStream.a(APKOutputStream.java)

..com.adobe.air.apk.APKOutputStream.addApplicationDescriptor(APKOutputStream.java)

..com.adobe.air.ApplicationPackager.addSpecialFiles(ApplicationPackager.java)

..com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java)

..com.adobe.air.ADT.parseArgsAndGo(ADT.java)

..com.adobe.air.ADT.run(ADT.java)

..com.adobe.air.ADT.main(ADT.java)

Stack trace: ..java.base/java.lang.Thread.getStackTrace(Thread.java:1602) ..com.adobe.air.DebugFile.printStack(DebugFile.java) ..com.adobe.air.ADTException.(ADTException.java) ..com.adobe.air.apk.APKOutputStream.a(APKOutputStream.java) ..com.adobe.air.apk.APKOutputStream.addApplicationDescriptor(APKOutputStream.java) ..com.adobe.air.ApplicationPackager.addSpecialFiles(ApplicationPackager.java) ..com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java) ..com.adobe.air.ADT.parseArgsAndGo(ADT.java) ..com.adobe.air.ADT.run(ADT.java) ..com.adobe.air.ADT.main(ADT.java)

ADT exception: aapt tool failed:C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\savedstate-1.2.1-res\values\values.xml:3: error: Found tag id where item is expected

C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\lifecycle-viewmodel-2.6.1-res\values\values.xml:3: error: Found tag id where item is expected

C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\lifecycle-runtime-2.6.1-res\values\values.xml:3: error: Found tag id where item is expected

C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\activity-1.7.0-res\values\values.xml:4: error: Found tag id where item is expected

C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\constraintlayout-2.1.4-res\values\values.xml:1491: error: Attribute "android:translationX" has already been defined C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\constraintlayout-2.1.4-res\values\values.xml:1495: error: Attribute "android:translationY" has already been defined C:\Windows\Temp\f990cf67-f1ad-4b35-af3a-f00818793a97\constraintlayout-2.1.4-res\values\values.xml:1498: error: Attribute "android:translationZ" has already been defined

ajwfrost commented 1 year ago

Okay so there's no values being picked up from the adt.log file.. probably because of how it's running and the fact that the user 'home' folder isn't what you'd expect (running sandboxed?):

Android SDK path platform default installation: C:\Windows\system32\config\systemprofile/AppData/Local/Android/Sdk

So I would suggest putting an adt.cfg file into the AIR SDK's "lib" folder, and giving this an Android SDK value like:

AndroidPlatformSDK=C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk

or wherever you have it installed.

Failing that you could copy the Android SDK into the place where it's looking,

C:\Windows\system32\config\systemprofile\AppData\Local\Android\Sdk

FYI it also looks like you may need that .airsdk folder to be replicated under that systemprofile folder if you want to pick up the config file (or license file) from there..

thanks

shaymolho commented 1 year ago

thanks, i solved it with adding adt.cfg to C:\Windows\System32\config\systemprofile.airsdk