airsdk / Adobe-Runtime-Support

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

i have this error when i using adobe air sdk ver 33.1.1.713 urgent #1506

Open atiani opened 2 years ago

atiani commented 2 years ago

hi sir when i used sdk ver33.1.1.713 in adobe animate and export andriod app the program show me this error :

andriod Gradle-based package creation needs an andriod sdk path to be provided [-platformsdk].

please help me

ajwfrost commented 2 years ago

Hi Please edit the file in the AIR SDK "lib" folder called "adt.cfg" - there's a placeholder where you need to add the path to an Android SDK (if you're on Windows, please use forward-slashes in the path). thanks Andrew

moazatiani commented 2 years ago

Thank you Sir , the problem disappeared but another case i see when i create apk file using this sdk and after running app in android device the app show me only empty white page without any contents so how to solve that
with my respect

ajwfrost commented 2 years ago

The most common cause of a blank white screen on start-up is if there's an error during the initialisation of the AIR app, frequently related to ANE/extension files. Are you able to connect to ADB and use adb logcat to see if there are any error messages from AIR as it starts up?

moazatiani commented 2 years ago

how to use adb logcat ?

moazatiani commented 2 years ago

how to connect adb

ajwfrost commented 2 years ago

If you go to the AIR SDK "lib\android\bin" folder (or the Android SDK "platform-tools" folder) you should see the "adb.exe" (or "adb" on Linux/Mac) executable file. If you open a console/terminal window and go to this folder, you can then just type: adb devices - lists the connected devices (simplest is to plug it in via USB, or it also recognises the emulator .. and then simplest if you ensure there's only one connected device for the rest of the instructions) adb logcat -c - clears the log, so type this before you then perform the action on the device adb logcat - starts logging to standard output, press ctrl-C to stop it. I usually run adb logcat > log.txt and then ctrl-C once the blank screen is shown, then edit the log.txt file..

moazatiani commented 2 years ago

thank you about this strategy but sir i funded the problem when i using distriqt anes like advert ane inside my app and publishing to apk , so after that i see the apk file after created it didn't contains the anes files and when i running in emulater or real android device the app show me white page again, on the other hand the problem related with air sdk 33.1.1713 only

any suggestion to solve this problem

ajwfrost commented 2 years ago

@moazatiani Are you using the very latest version of the ANEs from distriqt? If you can use the logcat tool to capture the trace, it may tell us what's happening during the start-up..

HectorArivar commented 2 years ago

Hi I have the same problem andriod Gradle-based package creation needs an andriod sdk path to be provided [-platformsdk].

I followed these steps but I don't know where the route is added.

Please help me

ROBERT-MCDOWELL commented 2 years ago

same here, I downloaded from android "platform-tools" changed the path in adt.cfg but adb seems to not be compatible when published showing a warning with adb options Also impossible to recognize any device through USB, I tried with 5 smartphones from android 5.1 to android 11. windows 10 recognize it but Animate does not show anything in publishing window. why is it so hard to simply publish in APK today?

ajwfrost commented 2 years ago

Hi

So if you've got an Android SDK downloaded, then you need to have the adt.cfg file set up with this path per the templated value in that file (the config file is in the AIR SDK's "lib" folder). That should then mean you no longer have the "Android Gradle-based package creation needs an Android SDK path" error. You may then see one about JAVA_HOME which you can set up as the JDK that's found in an Android Studio installation, again it can be put into the adt.cfg file.

If you've got a problem with ADB then please check what platform tools you're using from your Android SDK: the "adb" from there should work (e.g. "adb devices" should find your connected phones). Our recent AIR SDKs also picked up this more recent ADB version so it should also be possible to go to the AIR SDK "lib\android\bin" folder and run "adb devices" and get the same results.

If you're still having an issue please let us know what AIR SDK version plus what the error messages are.

If you want to revert back to the earlier (non-Gradle) way of packaging up an APK file, you can add the true setting into the section of your app descriptor file... but we needed to move to Gradle for Android App Bundle and were starting to struggle with some of the other Android tools used by the old process (aapt, dx etc) which are no longer supported by Google/Android.. hence moving across to use the same mechanism as them. It also means you can actually generate an Android Studio project and then use that to run/debug Android applications on emulators or devices; if you also use a 'remote debug' option from an ActionScript IDE you can still do that, and it gives us some other options for improving the overall workflows for debugging and deployment...

thanks

ROBERT-MCDOWELL commented 2 years ago

@ajwfrost thanks for your answer. I really think the best would be to have a help page describing step by step what to do to be ready to publish for android with different IDE like animate etc. because for now I'm sorry to say your solution is not clear at all. FYI with android studio or without the issue still the same. the path of animate insists that the path start with "/platform-tools/adb" which does not exist in android studio. So I doenloaded from android platform-tools and set the path in adt.cfg but no success, adb is not recognized.

ajwfrost commented 2 years ago

Hi @ROBERT-MCDOWELL yes good point, we've kind of just used this forum to explain it so will try to also get an update to the developer website and put more details into the release notes for it..

On this issue though, I'm not 100% clear:

the path of animate insists that the path start with "/platform-tools/adb" which does not exist in android studio. So I downloaded from android platform-tools and set the path in adt.cfg but no success, adb is not recognized.

Animate itself shouldn't need to know anything about ADB, instead this would come from the AIR SDK and the 'ADT' tool. The way this works is: a) if there is a platformsdk setting provided (either from the adt.cfg file, or from the command-line) then it assumes this is a path to the Android SDK and then checks the standard ADB locations of either [AndroidSDK]/tools/ or [AndroidSDK]/platform-tools/ b) if not, it uses the ADB that's provided within the AIR SDK itself, under [AIR SDK]/lib/android/bin/ And if you're on Windows it assumes "adb.exe", or on Mac/Linux it would look for "adb"

So if you can check that your Android SDK does actually include the ADB tool under either 'tools' or 'platform-tools' then it would be good - this isn't the same path as Android Studio, this is more likely to be in "c:\users\username\appdata\local\android\sdk" if you're using Windows. (I'm wondering whether we should add an automatic look-up for this location in case it's not given, since it's a fairly standard setting and could reduce these sorts of issues!)

Hope that helps; it might be worth checking the ADB versions that you see both in the Android SDK platform tools and in the AIR SDK location, since there was an ADB update recently that meant additional warnings were being displayed by it which then caused some IDEs to think there was an error - which is why we then updated our own version, so there shouldn't be a disparity. You can run "adb version" e.g. I get:

Android Debug Bridge version 1.0.41
Version 30.0.4-6686687
Installed as i:\SDKs\33.1.1.743\lib\android\bin\adb.exe

thanks

ROBERT-MCDOWELL commented 2 years ago

@ajwfrost thanks for the details. yes I'm on win 10. it seems that adb does not work at all on my laptop I don't know why. no phone are recognized through air publishing. however I just installed AIR SDK 32.0.0.116 and adb works and so publishing too. is there a way to update adb independently?

mgravano commented 2 years ago

Hi, I followed all the steps above, but I still get the error "Andriod Gradle-based package creation needs an andriod sdk path to be provided [-platformsdk]." I reproduce below the path that I included in my adt.cfg file in case I'm doing something wrong. I am using Adobe Animate in Windows.

`# For convenience, rather than using "-platformsdk" on the command line, these can be set up here:

AndroidPlatformSDK="C:/Users/matia/AppData/Local/Android/Sdk"

iOSPlatformSDK=path_to_sdk`

What else could be missing? Please, if someone could help me I would appreciate it, I don't know where to go next. Thank you.

ajwfrost commented 2 years ago

@ROBERT-MCDOWELL - the way we normally get ADB is from the Android Studio and the SDK Manager... in Android Studio, Tools menu -> SDK Manager, then click on the "SDK Tools" tab (underneath the SDK location text field) and choose the "Android SDK Platform-tools". It may also be worth getting the "Google USB driver" if you're having connectivity issues?

@mgravano just to check in the file: a line starting with a # is ignored as a comment, so if that really is what you have, you just need to delete the first character... so perhaps try the below?

AndroidPlatformSDK=C:/Users/matia/AppData/Local/Android/Sdk

thanks

mgravano commented 2 years ago

Thanks, that seems to have worked, but now it tells me: java_home does not point to a valid jdk installation, which is required for Android App Bundle creation

ajwfrost commented 2 years ago

If you've got Android Studio installed, then you can probably add another line for this, something like:

JAVA_HOME=c:/Program Files/Android/Android Studio/jre

thanks

mgravano commented 2 years ago

That worked too, thank you very much! :-) But now I have another problem: my .p12 file was created in 2010, it needs an old java version. With the version of Java that Animate 2022 has, it does not work. I had previously solved it by installing an old version of Java in the jre folder in Adobe Animate, but the new Animate is not letting me do it. Do you have any idea how I can solve this issue? Or better yet, how can I update my .p12 file?

ajwfrost commented 2 years ago

Hi @mgravano - if your certificate is 1024-bit then you will be a bit constrained here .. you'll need to use the first of the 1.8 JDK releases which still supports that format, and will need to use the "legacy" APK build mode so that it doesn't use Gradle. To set up for this, add the flag <BuildLegacyAPK>true</BuildLegacyAPK> into the <android> section of your application descriptor file.

You'll then just be able to create an APK file. If you need an App Bundle then I would suggest manually creating this from the command line via ADT, and not providing any signing details for this. You can then sign it using 'jarsigner' from the 1.8 JDK, and see also the instructions in the second half of this article: https://airsdk.dev/docs/tutorials/platform/android/packaging-android-app-bundles

As far as I'm aware, you can't change the .p12 file or update the certificate used without also changing the application ID..

marchbold commented 2 years ago

You can sort of change your p12 now when you switch to Play App Signing. You can upload your existing 1024bit p12 to Play App Signing which Google will use to sign your apk's delivered to clients, then create a new 2048bit upload certificate that you can use to debug with apks and create an aab for submission.

Check the details on that page around the "Upload Certificate".

mgravano commented 2 years ago

Thanks guys! I'm going to try these solutions you tell me.

Dinesh1974 commented 2 years ago

I having the same problem publishing in adobe animate on Mac . I edited the path adt.cfg, but it still doesn't work. "# For convenience, rather than using "-platformsdk" on the command line, these can be set up here:

AndroidPlatformSDK="~/Users/suer1/Library/Android/Sdk/"

iOSPlatformSDK="~/Users/suer1/Library/Android/Sdk/"

android-deployment-issue

ajwfrost commented 2 years ago

Just to check .. you need to remove the # from the start of the line..? thanks

Dinesh1974 commented 2 years ago

thanks for the response. Yes it did work, but now I am getting a new error. Invalid input. sdk must refer to a valid directory path

Dinesh1974 commented 2 years ago

I have edited the path in adt.cfg, removed the # from the start of the line, but it still doesn't work.

Invalid input. sdk must refer to a valid directory path

ajwfrost commented 2 years ago

So that output happens if the 'file' given to set up the SDK path is (a) null, (b) non-existent, or (c) not a directory. Can you please try:

AndroidPlatformSDK=/Users/suer1/Library/Android/Sdk

so without the quotes, and without a terminating / character?

And also check from a terminal window: file /Users/suer1/Library/Android/Sdk

thanks

Dinesh1974 commented 2 years ago

I tried and I have a new error showing up Invalid input.

Warning: Application has not specified its permission requirements in application.xml NOTE: Multiple Android build-tools folders exist, choosing the latest version (32.1.0 rc1) for packaging

Dinesh1974 commented 2 years ago

I have removed the Multiple Android build tools and choose the latest version, But I am still getting the WARNING

Invalid input. Warning: Application has not specified its permission requirements in application.xml

Dinesh1974 commented 2 years ago

It is also asking "JAVA_HOME does not point to a valid JDK installation, which is required for Android App Bundle creation".

Dinesh1974 commented 2 years ago

It is still giving an "invalid input" error "JAVA_HOME does not point to a valid JDK installation, which is required for Android App Bundle creation. This is path I have given in adt.cfg file JAVA_HOME=/Macintosh HD/Applications/Android Studio/Contents/jr java_home e

ajwfrost commented 2 years ago

The warning about permissions, and the note about build tools, won't be a problem. The permissions warning just means you haven't specified any Android permissions that your application might need; build tools is just to let you know it's selected the latest of the options you have.

For the JRE I would expect the path to be something like: /Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home

Dinesh1974 commented 2 years ago

No that JRE path didn't work. Shouldn't Android Studio.app is one filename instead of Android\ Studio.app

Dinesh1974 commented 2 years ago

This is the file hierarchy

jre-file-hirearchy

ajwfrost commented 2 years ago

Hmmm... I just tried it on a mac using 33.1.1.713 and this works for me:

AndroidPlatformSDK=/Users/ukinanfr/Library/Android/sdk
JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home

(and before I included that JAVA_HOME directive, I got JAVA_HOME is not defined: this must point to a valid JDK installation for Android App Bundle creation)

Wondering whether it's also possible to use "/usr" ... can you open a terminal window and do which javac to find whether you have a Java compiler on the path there? I just tried it for me -> it found javac but this was Java 1.8 and you can't use that to build Android apps with Gradle... which javac may tell you the path you can use (take off the /bin to get the 'home' folder), but also try javac -version to ensure you're running JDK 11 or later.

BTW as an alternative, you can go back to the original APK generation mechanism if you edit your app descriptor file, in the <android> section add a line: <BuildLegacyAPK>true</BuildLegacyAPK>. The more we find people struggling with these settings, the more I think we should have made sure there was an automatic fallback to that if the right paths/tools weren't found..!

thanks

Dinesh1974 commented 2 years ago

Okay I will try...But I am working on Adobe Animate. Where should I edit my 'app descriptor file' to add this section. Sorry for my ignorance.

ajwfrost commented 2 years ago

I believe you will need to close down Animate while you do it.. but then if you shut down you should have a file like "MyProject-app.xml", if your Animate project is called "MyProject.fla" ?

It would then be lots of XML and hopefully an <android> section already exists .. if it doesn't you can just add it.

I may just accelerate the idea of making it do an automatic fallback, in case that causes problems! I think we have everything in place that we'd need to make a decision suitably early in the packaging process..

thanks

Dinesh1974 commented 2 years ago

Got it!. After adding it ..How do I generate the apk file? What should be next step to deploy as an android app. ?

ajwfrost commented 2 years ago

So if you've added that and saved it, you can open up Animate again and do the "Publish" to create the APK file. You can then put that onto a local phone and test it out...

If you want to deploy via the Google Play Store then you're actually going to need to create an App Bundle instead of an APK and that uses the Gradle mechanism so back to square one I'm afraid :-(

Dinesh1974 commented 2 years ago

I am still getting the same error "JAVA_HOME does not point to a valid JDK installation, which is required for Android App Bundle creation. Used the same path and added true. Not generating the apk file.

ajwfrost commented 2 years ago

..? if so, that implies that it's not trying to use the legacy APK mechanism so something didn't work in the app descriptor file.

Probably the simplest thing to do at this point is to start using an AIR SDK that always uses the old mechanism i.e. before we switched the Android APK building over to Gradle. That change was in 33.1.1.698 so perhaps try: https://airsdk.harman.com/download/33.1.1.686

thanks

Dinesh1974 commented 2 years ago

I have already installed AIR SDK and managed inside adobe animate. So should remove android studio and just keep this old mechanism and then try to deploy or do I need both. AIR-SDK

ajwfrost commented 2 years ago

No need to remove Android Studio, you're likely to need it in the future... If you download the other AIR SDK and extract it somewhere, you can then add it via that plus button in the top right of the above "Manage Adobe AIR SDK" box.

Dinesh1974 commented 2 years ago

Installed AIR SDK for windows and added in Adobe Animate. It still shows the same error

"same error "JAVA_HOME does not point to a valid JDK installation, which is required for Android App Bundle creation. "

ajwfrost commented 2 years ago

Installed AIR SDK for windows

but above you're using a mac..?

It sounds like you've not switched over to publish with the new SDK. So if you've added it, you'll see both of those listed in the "Manage..." dialog? and then you'd need to select which one to use in the publish settings.. I've not got a machine with Animate on it in front of me right now so can't remember the exact way of doing it..

Dinesh1974 commented 2 years ago

yes...I have selected AIR SDK Mac and then published it. But the same error("same error "JAVA_HOME does not point to a valid JDK installation, which is required for Android App Bundle creation. ") keeps showing up

ajwfrost commented 2 years ago

Hmmm... so I think we should get some debug enabled so that we can see what's happening there. If you find the SDK locations (probably worth doing this in both) and edit that "adt.cfg" file in the lib folders, please uncomment the line "DebugOut=true". Then, after you build, you should see a file in your home folder being created (~/adt.log) which will give information about the build process and what versions, paths etc it's using.

The other thing to do is to replace the "adt.jar" library (again in that lib folder) with the below one. You'll likely need to shut down Animate before doing that change, and it's worth backing up the existing adt.jar file before copying this one in:

adt.zip (zipped up)

thanks

Andrew

Dinesh1974 commented 2 years ago

I've uncommented the line and replaced adt.jar file in AIR SDK lib and it shows something like "Error: Unable to access jarfile /Applications/Adobe Animate 2021/AIR33.1/lib/adt.jar

ROBERT-MCDOWELL commented 2 years ago

apparently with animate 2022 the issue has gone....

Dinesh1974 commented 2 years ago

What would be steps to deploy an app with animate 2022? Do you need the Android Studio...AIR SDK etc.?