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

ANE to see Context ExtensionContext.createExtensionContext not created #3425

Closed kaizer1 closed 1 month ago

kaizer1 commented 1 month ago

after updating the version not to the latest, it stopped connecting to the context. In theory, the matter is in a different Android layout? But we are fighting with the whole team, but we cannot understand the reason

- extension.xml - version 51 - platform.xml - version 51 android library all update to max my manifest file: KiddoMagictestane 1.1.1 KiddoMagic Test ANE KiddoMagic Test ANE TestAne.swf standard false true true landscape gpu true true true true AppIconsForPublish/192.png AppIconsForPublish/144.png AppIconsForPublish/96.png AppIconsForPublish/72.png AppIconsForPublish/48.png AppIconsForPublish/36.png false false ]]> true kiddo The application is built and launched, but calls from Android ANE (android java library to wrapper to ANE ) do not work
ajwfrost commented 1 month ago

This might be a platform-specific issue .. what are you running it on, and how are you packaging the APK?

So e.g. if the APK is built for armv8, or if you're using an AAB file, then it might be that the ANE doesn't have support for armv8 (Android-ARM64) built in...?

Generally there should be some output information via logcat that you can get, e.g. if you run

adt -deviceLog -platform android

then you'll see the ADB logcat logging from Android, you can redirect it to a file e.g.

adt -deviceLog -platform android > logfile.txt 2>&1

and then open your application; once it's got to the failure point, type "quit" (and hit enter) and the logging should stop.

thanks

kaizer1 commented 1 month ago

I compile and android armv8 compile with this command: adt -package -target apk -arch armv8 -storetype pkcs12 -keystore "cert.pfx" -storepass 1234 "KiddoMagicTestAne-ARM.apk" "manifest.xml" "TestAne.swf" "ytUtils.dat" "thumb.jpg" "video_data.json" "AppIconsForPublish" -extdir "" -platformsdk "Q:\AndroidSDK".

But it compiles everything fine and there is no error in the logs. It just does not return the context to me, that's the problem

ajwfrost commented 1 month ago

Hi

Would you be able to share us the APK file that you've created with this, so that we can run it and inspect it with the debug tools/runtime to see what's happening? https://transfer.harman.com/requests/Y76yJJE82QlYI8gptQHrU0

thanks

kaizer1 commented 1 month ago

Yes, of course, just a second

kaizer1 commented 1 month ago

i send apk ( two hour later )

ajwfrost commented 1 month ago

Thanks - received this and can run it, we can see the extension's SWF data is being loaded so it looks like it's packaged properly and the platform details are all fine. The Java code seems to have been compiled in (classes2.dex).

I think we'll need to put in a debug runtime and re-package the APK, in order to find out what's actually happening. Just to check though, to trigger a call to create an ExtensionContext and call a method in the ANE, do we have to press any particular button, or just anything?!

thanks

kaizer1 commented 1 month ago

Yes, there are several buttons made there and any of them calls a certain function in the attached () android library the corresponding command. So, now the command is not called in any way... For the reason that we do not create a context, if you run the source code in animata - then you can see it - I can upload the source code to the repository and give you a link so that you can try to compile it yourself

kaizer1 commented 1 month ago

?????

kaizer1 commented 1 month ago

@ajwfrost please help me. My project is at a dead end

ajwfrost commented 1 month ago

Sorry, we're working through a fair backlog of issues at the moment, will try to get you some feedback soon..

kaizer1 commented 1 month ago

Thank you, I understand.

ajwfrost commented 1 month ago

Just a couple of notes - we've started looking at it now, and reproduced it having built it here.

  1. If you want to build your extension library, without Animate, you can use the below line - the benefit of this being, you can include trace statements by setting the debug value to true.

    compc -load-config=[AIRSDK path]\frameworks\air-config.xml -include-sources="." -debug=true -swf-version=50 -output=library.swc
  2. Your app descriptor was using the old multidex support library? it should really be using the new androidx one now:

    <application android:hardwareAccelerated="true"
    android:name="android.support.multidex.MultiDexApplication"
    android:enabled="true"
    android:debuggable="true">

    should be

    <application android:hardwareAccelerated="true"
    android:name="androidx.multidex.MultiDexApplication"
    android:enabled="true"
    android:debuggable="true">

The actual problem appears to be with packaging i.e. within ADT. Because it's not generating the build system properly - your "classes.jar" isn't being provided to Gradle for building... so we should be able to do some debugging within ADT to see what's going wrong... will try to either let you know if there's a workaround, or get a fix for this into our forthcoming release.

thanks

kaizer1 commented 1 month ago

Thank you very much, I will wait

ajwfrost commented 1 month ago

Okay so actually, not a problem with ADT, I had forgotten that the extension JAR file got moved from the ANE-based sub-project into the main project, and renamed to ExtensionID.jar...

When running it with some debugging, we get the output

unable to load custom class com.kidshomealone.ane.KiddoMagicExtension

And looking at the classes.jar file that you're generating as part of your 'Android' build, it doesn't actually contain any of your own classes... something is very wrong with the way that you are creating that library file.

I've just been trying to find some tutorial on this because I know we have one somewhere, but can't find it - potentially it was just description within an issue like this and never made it out separately. But to create the classes.jar file for an Android ANE, I would suggest using Android Studio to create a library project. If you unzip an .aar file that this will generate, you can get at the JAR file - or it should be possible with our latest SDK to use the .aar file itself. See https://developer.android.com/studio/projects/android-library

thanks

kaizer1 commented 1 month ago

Thank you, but the thing is that I specialize in Android. And there I create exactly what is needed - a library. It's very strange, but thank you very much for your help, now I know which way to look

kaizer1 commented 1 month ago

I'll check everything again and close (in a day or two) this thread, okay?

ajwfrost commented 1 month ago

Sure that's fine. FYI, I didn't know exactly how it was building/packaging, but was just checking the contents of the classes.jar file using "unzip -l" to list the .class files. And the ones with your ANE package names didn't appear to be there.

thanks