airsdk / ANE-PlayAssetDelivery

Play Asset Delivery ANE
2 stars 2 forks source link

initAssetDelivery() returns false #7

Closed neibucrion closed 2 years ago

neibucrion commented 2 years ago

Here is basically my code inspired by the one in the README :

`import com.harman.extension.PlayAssetDelivery;

         var assets:PlayAssetDelivery = new PlayAssetDelivery();
                    trace("PlayAssetDelivery launched"); //This is OK
        if (assets.initAssetDelivery())
        {
                // PlayAssetDelivery initialised
                trace("PlayAssetDelivery initialised"); //This doesn't show
        }
                    else
        {
            trace("PlayAssetDelivery initialising failed"); //this appears
        }`

It doesn't work neither in my editor (FlashDevelop) neither on my phone when I compile the aab and download it on my phone. Do you know what I could be doing wrong ?

ajwfrost commented 2 years ago

For initAssetDelivery() to fail, something has gone fairly fundamentally wrong! Am wondering if there's a library missing or similar; are you able to run it on your phone with logcat running so that we can see if there are any logs about it?

thanks

neibucrion commented 2 years ago

So, after intense testing, I can confirm to you what I wrote previously. PlayAssetDelivery doesn't initialize. I suppose that if there was a library missing "adt" wouldn't have gone through with the compilation and would have fired an error message.

Basically I've got all my graphical resources mainly as "swfs" files and some as bitmaps in a "swfs" directory that I'm sending as a PlayAssetDelivery.

My android app descriptor contains the assetpack declaration in the "android" section (assetPack id="SwfsAssetPack" delivery="install-time" folder="swfs") and the extensionID of the library (com.harman.PlayAssetDelivery) in the "extensions" section.

Joined to this message are the logs of the aab compilation, the local-testing launch and the logcat of the app. I don't see anything unusual...

$ adt -package -target aab-debug -storetype pkcs12 -keystore "certifNarraFlux.p12" -storepass xxxxx AStreetStory.aab "..\appAndroid.xml" "INFlash.swf" -C "..\bin" "moteurFinal.swf" "\icons\AStreetStory36.png" "\icons\AStreetStory48.png" "\icons\AStreetStory72.png" "scenario.xml" "scenes" "musiques" "swfs" -extdir "..\extensions" -platformsdk "C:\Users\erniu\AppData\Local\Android\Sdk" NOTE: Multiple Android build-tools folders exist, choosing the latest version (30.0.3) for packaging

$ java -jar bundletool-all-1.8.2.jar build-apks --bundle="AStreetStory.aab" --output="AStreetStory.apks" --local-testing INFO: The APKs will be signed with the debug keystore found at 'C:\Users\erniu\.android\debug.keystore'.

$ java -jar C:\AirSdk\lib\android\lib\bundletool.jar install-apks --apks="AStreetStory.apks" The APKs have been extracted in the directory: C:\Users\erniu\AppData\Local\Temp\3704755827325517279 The APKs have been extracted in the directory: C:\Users\erniu\AppData\Local\Temp\3704755827325517279 ADB << rm -rf '/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing' ADB >> OK ADB << mkdir -p '/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing' && rmdir '/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing' && mkdir -p '/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing' ADB >> OK Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-xxhdpi.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-master_2.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-da.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-ja.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-nb.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-de.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-th.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-fi.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-vi.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-el.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-nl.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-pl.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-in.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-ko.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-fr.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-tr.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-cs.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-es.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-ms.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-it.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-pt.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-ru.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-sv.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-iw.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-zh.apk" Pushed "/sdcard/Android/data/air.com.Narraflux.AStreetStory/files/local_testing/base-arm64_v8a_2.apk" ADB << run-as 'air.com.Narraflux.AStreetStory' rm -rf '/data/data/air.com.Narraflux.AStreetStory/files/splitcompat' ADB >> run-as: package not debuggable: air.com.Narraflux.AStreetStory Failed to remove working directory with local testing splits. Your app might still have been installed correctly but have previous version of dynamic feature modules. If you see legacy versions of dynamic feature modules installed try to uninstall and install the app again.

$ adb logcat air.com.Narraflux.AStreetStory:V *:S --------- beginning of crash --------- beginning of system --------- beginning of main 01-29 00:38:31.966 25566 25566 I air.com.Narraflux.AStreetStory: PlayAssetDelivery launched 01-29 00:38:31.968 25566 25566 I air.com.Narraflux.AStreetStory: PlayAssetDelivery initialising failed 01-29 00:38:31.972 25566 25566 I air.com.Narraflux.AStreetStory: Entre dans chargeImageAndroid pour l'image pause.swf 01-29 00:38:31.974 25566 25566 I air.com.Narraflux.AStreetStory: Asset non initialised for opening file pause.swf 01-29 00:38:31.985 25566 25566 I air.com.Narraflux.AStreetStory: Entre dans chargeImageAndroid pour l'image intro_english.swf 01-29 00:38:31.987 25566 25566 I air.com.Narraflux.AStreetStory: Asset non initialised for opening file intro_english.swf 01-29 00:38:31.987 25566 25566 I air.com.Narraflux.AStreetStory: Entre dans chargeImageAndroid pour l'image fond_option.swf 01-29 00:38:31.989 25566 25566 I air.com.Narraflux.AStreetStory: Asset non initialised for opening file fond_option.swf 01-29 00:38:31.996 25566 25566 I air.com.Narraflux.AStreetStory: Entre dans chargeImageAndroid pour l'image micro.swf 01-29 00:38:31.998 25566 25566 I air.com.Narraflux.AStreetStory: Asset non initialised for opening file micro.swf

ajwfrost commented 2 years ago

Hi Curious, it looks like everything is going okay and I don't see a message about the loading failure .. are you able to send us your bundle file and we can inspect it to see what's up (and if you build with "aab-debug" we can potentially get it to load a different/debug version of the ANE, I think..) thanks

https://transfer.harman.com/requests/kVdU85laCiDNStDGIn4vgJ

neibucrion commented 2 years ago

Ok. I tried one last thing before answering. I wondered if maybe the fact that my main swf wasn't compiled originally with the latest Harman airsdk could be a problem so I updated my overlay of the flex+airsdk (4.6.0+32.0) installation in FlashDevelop with the latest Harman release (33.1.1.743). I saw the Harman logo appear while testing inside the editor and it didn't before, so the changes were taken into account. I compiled everything again but it still doesn't want to initialize thePlayAssetDelivery() object, neither in the editor or on the phone. I'll send you the aab file. Tell me if you need more.

ajwfrost commented 2 years ago

Hi @neibucrion

Thanks for that. So, the extension does appear to have all the architectures supported (I had wondered if one of the jar files hadn't been picked up if you had been using an earlier version of the ANE where we were trying to get AIR to just pick up all the functionality via the 'default' options..)

But there are a couple of dependencies which it seems we haven't documented very well .. I think these are added for you automatically if you use apm, but can you try manually perhaps:

1) adding the below to your Android manifest additions within your app descriptor file:

    <application android:enabled="true">
        <activity
            android:name="com.google.android.play.core.common.PlayCoreDialogWrapperActivity"
            android:enabled="false"
            android:exported="false"
            android:stateNotNeeded="true" />
        <service
            android:name="com.google.android.play.core.assetpacks.AssetPackExtractionService"
            android:enabled="false"
            android:exported="true" />
        <service
            android:name="com.google.android.play.core.assetpacks.ExtractionForegroundService"
            android:enabled="false"
            android:exported="false" />
    </application>

2) also within the app descriptor, include another ANE which brings in the play asset APIs:

        <extensionID>com.google.android.play</extensionID>

thanks

neibucrion commented 2 years ago

Thank you very much. I'll probably use apm.

Le lun. 31 janv. 2022 à 00:04, Andrew Frost @.***> a écrit :

Hi @neibucrion https://github.com/neibucrion

Thanks for that. So, the extension does appear to have all the architectures supported (I had wondered if one of the jar files hadn't been picked up if you had been using an earlier version of the ANE where we were trying to get AIR to just pick up all the functionality via the 'default' options..)

But there are a couple of dependencies which it seems we haven't documented very well .. I think these are added for you automatically if you use apm, but can you try manually perhaps:

  1. adding the below to your Android manifest additions within your app descriptor file:

  2. also within the app descriptor, include another ANE which brings in the play asset APIs:

    <extensionID>com.google.android.play</extensionID>

thanks

— Reply to this email directly, view it on GitHub https://github.com/airsdk/ANE-PlayAssetDelivery/issues/7#issuecomment-1025253478, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFU7XBKRUVWTBZAFCZHIV4DUYW7ZDANCNFSM5NBAZSEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

neibucrion commented 2 years ago

Ok ! It works perfectly with apm. I didn't know that all these tools had been developed recently for Flash Development. You're doing a really great job !

Thanks !

marchbold commented 2 years ago

@neibucrion Great to hear you are using apm! Love to hear any feedback you may have on the installation and usage of apm?

neibucrion commented 2 years ago

No problem. Everything went smoothly with the docs. I had to install separately an ANE for Steam implementation ( https://github.com/Ventero/FRESteamWorks). I wondered if you could maybe put it on apm...

Eric

Le mer. 2 févr. 2022 à 00:50, Michael @.***> a écrit :

@neibucrion https://github.com/neibucrion Great to hear you are using apm! Love to hear any feedback https://github.com/airsdk/apm/discussions/new you may have on the installation and usage of apm?

— Reply to this email directly, view it on GitHub https://github.com/airsdk/ANE-PlayAssetDelivery/issues/7#issuecomment-1027401397, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFU7XBOBZIWLYBKJ24MWNB3UZBWUNANCNFSM5NBAZSEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

marchbold commented 2 years ago

I'll put it on my list but have a lot on at the moment so might not be any time soon.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 5 days with no activity.

Oldes commented 5 months ago

@ajwfrost where one can find above mentioned com.google.android.play ANE and should not it be mentioned in the wiki page... https://github.com/airsdk/ANE-PlayAssetDelivery/wiki

marchbold commented 5 months ago

@Oldes, this is one of ours from the GooglePlayServices repo: https://github.com/distriqt/ANE-GooglePlayServices/tree/master/lib

Note apm would handle this for you:

apm install com.harman.PlayAssetDelivery
apm generate app-descriptor