airsdk / ane-playassetdelivery Goto Github PK
View Code? Open in Web Editor NEWPlay Asset Delivery ANE
Play Asset Delivery ANE
I'm resurrecting a project that uses NetStream to load mp4 files. I'm currently troubleshooting this process. I'm using the On Demand method for PAD, but I'm receiving the following error: Error #2004: One of the parameters is invalid "appendbytes"
Before I even begin to rebuild the methods handling the video clips and troubleshoot the error, I want to make sure that I can even use AppendBytes, or is this still limited to FLVs? If so, should I try the Fast Follow method? Thanks.
Maybe it would be more educative to have real ANE's sources and not just the binary ANE itself, wouldn't it?
The app should not crash if initializing PlayAssetDelivery or calling its functions fetchAssetPack() or getAssetPackStatus().
I made a demo to test PlayAssetDelivery and am experiencing crashes the first several times I open the app and try to initialize PlayAssetDelivery. Usually the first time I start the app, I can call initAssetDelivery(). Then if I call fetchAssetPack(), the app will crash and close a few seconds later. I then restart the app and it will usually crash and close after I all initAssetDelivery(). After a few more crashes, the crashes stop, and PlayAssetDelivery is working as it should (I can access my asset packs).
This only seems to occur if I install from the Google Play Store internal testing. It does not occur if I install it directly on the device using bundletool. I have tested it on a Galaxy Tab A (8.0", 2019) Android version 11 and Galaxy S8 Android version 9.
I am only using fast-follow.
Here is my logcat log:
05-23 13:45:27.907 854 26118 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
05-23 13:45:27.908 854 2033 D Debug : low && ship && 3rd party app crash, so skip dump
05-23 13:45:27.908 854 2033 W ActivityManager: crash : [APP ID],10347
05-23 13:45:27.921 854 2033 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1162 com.android.server.am.AppErrors.crashApplicationInner:579 com.android.server.am.AppErrors.crashApplication:443 com.android.server.am.ActivityManagerService.handleApplicationCrashInner:12392 com.android.server.am.ActivityManagerService.handleApplicationCrash:12327
05-23 13:45:27.922 854 2033 W ActivityTaskManager: Force finishing activity [APP ID]/.AIRAppEntry
05-23 13:45:27.927 854 2033 V WindowManager: Prepare app transition: transit=TRANSIT_CRASHING_ACTIVITY_CLOSE mNextAppTransition=TRANSIT_UNSET alwaysKeepCurrent=false displayId=0 Callers=com.android.server.wm.DisplayContent.prepareAppTransition:5809 com.android.server.wm.DisplayContent.prepareAppTransition:5803 com.android.server.wm.ActivityStack.finishTopCrashedActivityLocked:2733 com.android.server.wm.RootWindowContainer.finishTopCrashedActivities:2654 com.android.server.wm.ActivityTaskManagerService$LocalService.finishTopCrashedActivities:8921
05-23 13:45:27.930 854 2033 V WindowManager: Prepare app transition: transit=TRANSIT_TASK_CLOSE mNextAppTransition=TRANSIT_CRASHING_ACTIVITY_CLOSE alwaysKeepCurrent=false displayId=0 Callers=com.android.server.wm.DisplayContent.prepareAppTransition:5809 com.android.server.wm.DisplayContent.prepareAppTransition:5803 com.android.server.wm.ActivityRecord.finishIfPossible:3181 com.android.server.wm.ActivityRecord.finishIfPossible:3053 com.android.server.wm.ActivityStack.finishTopCrashedActivityLocked:2735
05-23 13:45:27.930 854 2033 D WindowManager: isScreenshotDisabledLocked - win: Window{7bfc5fe u0 InputMethod}
05-23 13:45:27.930 854 2033 D WindowManager: isScreenshotDisabledLocked: userId = 0, disabled =false
05-23 13:45:27.930 854 2033 D WindowManager: isScreenshotDisabledLocked - win: Window{b13ed63 u0 [APP ID]/[APP ID].AIRAppEntry}
05-23 13:45:27.930 854 2033 D WindowManager: isScreenshotDisabledLocked: userId = 0, disabled =false
05-23 13:45:27.942 517 523 E statsd : Predicate 5980654721335871649 dropping data for dimension key (10)0x2010101->10347[I] (10)0x30000->launch[S]
05-23 13:45:27.943 517 523 E statsd : Predicate -7037417284711607308 dropping data for dimension key (10)0x2010101->10347[I] (10)0x30000->launch[S]
05-23 13:45:27.950 854 2033 V WindowManager: Setting visibility of Window{8596e19 u0 com.android.vending/com.google.android.finsky.activities.MainActivity}: true, caller=com.android.server.wm.WindowContainer.sendAppVisibilityToClients:1004 com.android.server.wm.ActivityRecord.setClientVisible:6391 com.android.server.wm.ActivityRecord.setVisibility:4866 com.android.server.wm.ActivityRecord.setVisibility:4764 com.android.server.wm.ActivityRecord.makeVisibleIfNeeded:5409
05-23 13:45:27.951 854 2033 D MARsPolicyManager: onPackageResumedFG pkgName = com.android.vending, userId = 0
Here is my manifest.
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="30" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true" />
<meta-data android:name="android.max_aspect" android:value="2.16" />
<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>
</manifest>
]]></manifestAdditions>
The anes in my project are:
These are bundletool commands I am using.
java -jar bundletool-all.jar build-apks --bundle=[BUNDLE NAME].aab --output=output.apks --ks=[KEYSTORE NAME].jks --ks-key-alias=[ALIAS] --local-testing --connected-device --adb=[ADB PATH]
java -jar bundletool-all.jar install-apks --apks=output.apks --adb=[ADB PATH]
I am trying the version 1.2.0 of this ANE. I have these assets in the manifest:
<assetPacks>
<assetPack id="asset_pack1" delivery="install-time" folder="assetpack1"/>
<assetPack id="asset_pack2" delivery="fast-follow" folder="assetpack2"/>
<assetPack id="asset_pack3" delivery="on-demand" folder="assetpack3"/>
</assetPacks>
Including all 3 folders when making the AAB package.
The install-time
delivery works as expected, but when I use code like this to fetch
the other packs:
var assets:PlayAssetDelivery = new PlayAssetDelivery();
assets.debugMode = true;
if (assets.initAssetDelivery()) {
assets.addEventListener( PlayAssetDeliveryEvent.PLAY_ASSET_UPDATE, playAssetDelivery_statusHandler );
assets.fetchAssetPack("Start.lvl");
}
I can see this error in the log:
2024-01-17 00:08:22.902 2484-2484 FetchAsset pid-2484 I FetchAsset
2024-01-17 00:08:22.902 2484-2484 FetchAsset pid-2484 I Input value is [Start.lvl]
2024-01-17 00:08:22.902 2484-2484 PlayAssetA...ionContext pid-2484 I setPlayAssetDeliveryManagerObj get
2024-01-17 00:08:22.902 2484-2484 PlayAssetD...eryManager pid-2484 D fetch()
2024-01-17 00:08:22.902 2484-2620 PlayCore pid-2484 I UID: [10456] PID: [2484] AssetPackServiceImpl : Initiate binding to the service.
2024-01-17 00:08:22.902 2484-2484 PlayCore pid-2484 I UID: [10456] PID: [2484] AssetPackServiceImpl : startDownload([Start.lvl])
2024-01-17 00:08:22.902 2484-2484 PlayAssetD...eryManager pid-2484 D fetch() end: status 0
2024-01-17 00:08:22.902 2484-2484 FetchAsset pid-2484 I FetchAsset end
2024-01-17 00:08:22.904 2484-2620 PlayCore pid-2484 I UID: [10456] PID: [2484] AssetPackServiceImpl : Waiting to bind to the service.
2024-01-17 00:08:22.927 2484-2484 PlayCore pid-2484 I UID: [10456] PID: [2484] AssetPackServiceImpl : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.assetmoduleservice.AssetModuleService})
2024-01-17 00:08:22.927 2484-2620 PlayCore pid-2484 I UID: [10456] PID: [2484] AssetPackServiceImpl : linkToDeath
2024-01-17 00:08:22.931 2484-2540 PlayCore pid-2484 I UID: [10456] PID: [2484] AssetPackServiceImpl : Leaving the connection open for other ongoing calls.
2024-01-17 00:08:22.931 2484-2540 PlayCore pid-2484 I UID: [10456] PID: [2484] AssetPackServiceImpl : onGetSessionStates
2024-01-17 00:08:22.941 31930-1598 Finsky com.android.vending E [266] kvh.a(845): Request execution failed with error code: -2
com.google.android.finsky.assetmoduleserviceutils.AssetModuleException: Request to PGS failed because all packs are unavailable.
at jlg.ads(PG:533)
at jqv.k(PG:75)
at ism.run(PG:70)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8893)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
2024-01-17 00:08:22.942 2484-2540 PlayCore pid-2484 E UID: [10456] PID: [2484] AssetPackServiceImpl : onError(-2)
2024-01-17 00:08:22.942 2484-2620 PlayCore pid-2484 I UID: [10456] PID: [2484] AssetPackServiceImpl : Unbind from service.
2024-01-17 00:08:22.942 2484-2484 PlayAssetD...eryManager pid-2484 W Exception in fetch asset pack completion handler: com.google.android.play.core.assetpacks.AssetPackException: Asset Pack Download Error(-2): The requested pack is not available. (https://developer.android.com/reference/com/google/android/play/core/assetpacks/model/AssetPackErrorCode.html#PACK_UNAVAILABLE)
2024-01-17 00:09:23.729 2793-3068 system_server system_server W ApkAssets: Deleting an ApkAssets object '<empty> and /data/app/~~eDpKdDiLqppYrmwnxhj7Zg==/com.sec.android.app.launcher--z6UznvbefN5XpkjxHBz1A==/base.apk' with 1 weak references
Tested with AIR 50.2.4 and android:targetSdkVersion="33"
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 ?
Hello, again I failed to find a proper place to ask this question.
Currently, my game is over 800 MB, so I have to use PAD in order to release it on Google Play. I use Starling's Asset Manager
to load/unload dynamically in-need assets from the disk. I assume the AssetManger
class has to be modified and add in Android Asset Pack Manager
's functionalities. (just like Java's Resources
class?) (I'm not an expert in Java so I maybe totally wrong).
Right now I'm a bit lost and don't know how to proceed. I thoroughly read the wiki page. I think it's easy to load in 1 single file from pad, but I need to recursively load/unload files from different directories (basically all the functionalities the AssetManger
provided). And as the game targets both iOS and Android, I hope the assets could be handled for both platforms.
Could you please point me in the right direction on how to proceed, or maybe an example project? Thank you so much for your help in advance!
Hi, I find the PlayAssetDeliveryEvent
Class is missing.
Another thing is that could you please provide a demo project so that we could follow it. I don't see an example for on-depand / fast-follow on the wiki page. As debugging is so difficult, I'm a bit lost here... Thanks again for your help!
@marchbold @ajwfrost
Hello, I'm debugging the aab with Asset Delivery and find that my program stops when I call any functions on the PlayAssetDelivery
instance. (getAssetPackStatus
, getTotalBytesToDownLoad
...). Here's the code:
var _pad:PlayAssetDelivery = new PlayAssetDelivery();
var _isPADInited:Boolean = _pad.initAssetDelivery();
if (_isPADInited) {
// PlayAssetDelivery initialised
trace("PlayAssetDelivery initialised"); // no problem to reach here
_pad.addEventListener(PlayAssetDeliveryEvent.PLAY_ASSET_UPDATE, playAssetDelivery_statusHandler)
trace("getAssetPackStatus: " + _pad.getAssetPackStatus("ap_assets_one"));
_pad.fetchAssetPack("ap_assets_one"); // <-------NEVER GET EXECUTED
trace("getTotalBytesToDownLoad: " + _pad.getTotalBytesToDownLoad("ap_assets_one"));
trace("getByteDownloaded: " + _pad.getByteDownloaded("ap_assets_one"));
trace("getTransferProgressPercentage: " + _pad.getTransferProgressPercentage("ap_assets_one"));
}
(FYI)
fetchAssetPack
first, and it also stops my program.distriqt|AndroidRuntime|System.err
, and I'm not seeing any error outputs.Thanks in advance!
Sometimes its dont work because a "random Binder died" errror is throwed.
Tested with v1.1.0 in Android 6 and 7.
"Looking" at the code, the error is in getPackStates().onComplete() -> task.getResult()
When the error is throwed, the ANE is capturing the error but dont do anything, so the app is waiting for an event that it never receives.
A solution is retry the task again until it works, or dispatch an event with "status=ERROR" and let the app decide what to do.
@marchbold Hello, we just release a new version and it failed in transfering asset stage. Please help!!
Here's log:
play store_2022_4_3_23_19_49.log
I am testing Play Asset Delivery ane in my apps.
<assetPacks>
<assetPack delivery="install-time" folder="Ap_Images" id="Ap_Images_asset_pack"/>
</assetPacks>
I want to use the files I installed with install-time to access them from within the application.
I found out that there is no path defined in apk for install-time.
I want to access and upload the file with a simple readBytes method.
I downloaded the last ane and edited the codes according to the description here.
but I keep getting an error, I am attaching the error code.
How should I proceed from here?
var bmp: Loader = new Loader();
var sayfa4mc: supercetineng = new supercetineng();
var assets: PlayAssetDelivery = new PlayAssetDelivery();
if (assets.initAssetDelivery()) {
// PlayAssetDelivery initialised
var asset: AssetFile = _assets.openInstallTimeAsset("Ap_Images/supercetineng.swf");
if (asset != null) {
var bytes = new ByteArray();
asset.readBytes(bytes);
asset.close();
var cont: LoaderContext = new LoaderContext();
cont.allowCodeImport = true;
bmp.contentLoaderInfo.addEventListener(Event.COMPLETE, handleAppLoaded);
bmp.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, handleProgress);
bmp.loadBytes(bytes, cont);
function handleProgress(e: ProgressEvent): void {
sayfa4mc.x = 0;
sayfa4mc.y = 0;
addChild(sayfa4mc);
addChildAt(sayfa4mc, 0);
}
function handleAppLoaded(e: Event): void {
sayfa4mc.x = 0;
sayfa4mc.y = 0;
bmp.x = 0;
bmp.y = 0;
sayfa4mc.addChild(bmp);
sayfa4mc.addChildAt(bmp, 1);
}
``
![error](https://user-images.githubusercontent.com/51246471/147097940-9fd7be0b-38cd-4865-bb33-a8fcf6eb2ed9.png)
}
I am loading files using File.url property.
Does this work using this ANE?
@marchbold @ajwfrost
Hello, I found a really strange bug. When I packaged aab file with adt -target aab-debug
with local-testing
, everything works fine.
Then I created a new release for Internal testing on Google Play's console, I packaged the aab file with adt -target aab
and uploaded it.
And then I downloaded it from Play Store, but calling either fetchAssetPack
or getAssetPackStatus
or getAssetPackLocation
would cause my app to freeze. I have called initAssetDelivery
before calling these 3 functions. initAssetDelivery
didn't freeze the app.
Here's the logs from the logcat:
12-30 08:33:59.524 I/PlayCore(28795): UID: [10383] PID: [28795] AssetPackServiceImpl : syncPacks
12-30 08:33:59.524 I/PlayCore(28795): UID: [10383] PID: [28795] AssetPackServiceImpl : syncPacks
12-30 08:33:59.525 I/PlayCore(28795): UID: [10383] PID: [28795] AssetPackServiceImpl : startDownload([ap_assets_one])
12-30 08:33:59.526 I/PlayCore(28795): UID: [10383] PID: [28795] AssetPackServiceImpl : Initiate binding to the service.
12-30 08:33:59.530 I/PlayCore(28795): UID: [10383] PID: [28795] AssetPackServiceImpl : Waiting to bind to the service.
12-30 08:34:02.984 I/com.voxverbi.b(28795): Waiting for a blocking GC ProfileSaver
12-30 08:34:02.996 I/com.voxverbi.b(28795): WaitForGcToComplete blocked RunEmptyCheckpoint on ProfileSaver for 8.364ms
12-30 08:34:20.331 I/com.voxverbi.b(28795): Wrote stack traces to tombstoned
12-30 08:34:20.331 I/com.voxverbi.b(28795): Wrote stack traces to tombstoned
12-30 08:34:28.014 W/FirebaseInstanceId(28795): Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval
Here's the full log file:
play store_2021_12_30_16_34_40.log
ps. Both ”on-demand” and ”fast-follow” are tried and the result is the same.
I also tested on multiple devices (google pixel, Samsung..) in different countries. (Just to eliminate the factor of China manufactured devices)
I think the adt command is correct as the debug version works fine. Here's the ant script for packaging:
<target name="package-aab">
<delete file="${output.dir}/Bf_android.aab"/>
<exec executable="${air.adt}" failonerror="true">
<arg line="-package"/>
<arg line="-target aab"/>
<arg line="-storetype PKCS12"/>
<arg line="-keystore /Users/mingjing/Development/Biofanta/certi/inUse/voxAndroidCerti.p12"/>
<arg line="-storepass ${password}"/>
<arg line="${output.dir}/Bf_android.aab"/>
<arg line="${output.dir}/Bf-android.xml"/>
<arg line="-C ${output.dir} Bf_Android.swf"/>
<arg line="-C ${basedir} assets"/>
<arg line="-extdir /Users/mingjing/Development/Biofanta/DigitalStrewberryAnes"/>
<arg line="-extdir /Users/mingjing/Development/Biofanta/Biofanta_dependency"/>
<arg line="-extdir ${basedir}/ane"/>
<arg line="-C ${source.dir}/res ."/>
<arg line="-C ${basedir}/InitAssets ."/>
</exec>
</target>
Is there any proper (complete) example available on how to use this ANE, or the API, cannot find any of those.
trying to include it in my project, and i m keep getting the error message:
-1046: Type was not found or was not a compile-time constant: AssetFile.
(using adobe animate 2024, AIR SDK 50.2.4.5
I'm currently trying to implement Assets delivery on demand in my application, but I'm not getting it to work. It's showing in logcat that the download was completed, but I'm not able to access the file inside the folder. Do you have an example of how to do this process?
Below is the structure I made in the app:
app.xml
<assetPacks> <assetPack id="audioAssetPack" delivery="on-demand" folder="audioAssetPack"/> </assetPacks>
My code:
`assetsOnDemand = new PlayAssetDelivery();
trace("!!!assets.initAssetDelivery() ", assetsOnDemand.initAssetDelivery())
if (assetsOnDemand.initAssetDelivery()){
assetsOnDemand.addEventListener(PlayAssetDeliveryEvent.PLAY_ASSET_UPDATE, playAssetDeliveryStatusHandler);
trace("!!!PlayAssetDelivery initialised");
trace("!!!PlayAssetDelivery initialised2", assetsOnDemand.fetchAssetPack("audioAssetPack"));
trace("!!!PlayAssetDelivery initialised3", assetsOnDemand.getAssetPackStatus("audioAssetPack"));
trace("!!!PlayAssetDelivery initialised6", assetsOnDemand.getAssetPackLocation("audioAssetPack"));
}
private function playAssetDeliveryStatusHandler(event):void {
trace( "asset pack name: " + event.assetPackName );
trace( "status: " + PlayAssetStatus.getStatus(event.status) ); // Value from PlayAssetStatus
trace( "location: " + assetsOnDemand.getAssetPackLocation("audioAssetPack"));
trace( "location2: " + assetsOnDemand.getAssetAbsolutePath("audioAssetPack", "audioAssetPack/sfx_peca_domino.mp3"));
trace( "location3: " + assetsOnDemand.getAssetAbsolutePath("audioAssetPack", "audioAssetPack\sfx_peca_domino.mp3"));
trace( "location4: " + assetsOnDemand.getAssetAbsolutePath("audioAssetPack", "sfx_peca_domino.mp3"));
trace( "location5: " + assetsOnDemand.getAssetAbsolutePath("audioAssetPack", "audioAssetPack"));
trace( "location6: " + assetsOnDemand.getAssetAbsolutePath("sfx_peca_domino.mp3", "audioAssetPack"));
trace( "location7: " + assetsOnDemand.getAssetAbsolutePath("audioAssetPack/sfx_peca_domino.mp3", "audioAssetPack"));
trace( "location8: " + assetsOnDemand.getAssetAbsolutePath("audioAssetPack\sfx_peca_domino.mp3", "audioAssetPack"));
}`
logcat output
2023-01-09 19:31:38.306 6368-6368/air.br.com.megajogos.mobile D/AppLovinAdapter: Requesting banner of size BANNER for zone: 757202f26f06f141 2023-01-09 19:31:38.363 6368-6368/air.br.com.megajogos.mobile I/air.br.com.megajogos.mobile: asset pack name: audioAssetPack 2023-01-09 19:31:38.363 6368-6368/air.br.com.megajogos.mobile I/air.br.com.megajogos.mobile: status: COMPLETED 2023-01-09 19:31:38.366 6368-6368/air.br.com.megajogos.mobile E/PlayCore: UID: [10264] PID: [6368] AssetPackStorage : Failed to find assets directory: /data/data/air.br.com.megajogos.mobile/files/assetpacks/audioAssetPack/119003029/119003029/assets 2023-01-09 19:31:38.366 6368-6368/air.br.com.megajogos.mobile I/air.br.com.megajogos.mobile: location: null 2023-01-09 19:31:38.370 6368-6368/air.br.com.megajogos.mobile E/PlayCore: UID: [10264] PID: [6368] AssetPackStorage : Failed to find assets directory: /data/data/air.br.com.megajogos.mobile/files/assetpacks/audioAssetPack/119003029/119003029/assets 2023-01-09 19:31:38.370 6368-6368/air.br.com.megajogos.mobile I/air.br.com.megajogos.mobile: location2: null 2023-01-09 19:31:38.373 6368-6368/air.br.com.megajogos.mobile E/PlayCore: UID: [10264] PID: [6368] AssetPackStorage : Failed to find assets directory: /data/data/air.br.com.megajogos.mobile/files/assetpacks/audioAssetPack/119003029/119003029/assets 2023-01-09 19:31:38.374 6368-6368/air.br.com.megajogos.mobile I/air.br.com.megajogos.mobile: location3: null 2023-01-09 19:31:38.377 6368-6368/air.br.com.megajogos.mobile E/PlayCore: UID: [10264] PID: [6368] AssetPackStorage : Failed to find assets directory: /data/data/air.br.com.megajogos.mobile/files/assetpacks/audioAssetPack/119003029/119003029/assets 2023-01-09 19:31:38.378 6368-6368/air.br.com.megajogos.mobile I/air.br.com.megajogos.mobile: location4: null 2023-01-09 19:31:38.382 6368-6368/air.br.com.megajogos.mobile E/PlayCore: UID: [10264] PID: [6368] AssetPackStorage : Failed to find assets directory: /data/data/air.br.com.megajogos.mobile/files/assetpacks/audioAssetPack/119003029/119003029/assets 2023-01-09 19:31:38.383 6368-6368/air.br.com.megajogos.mobile I/air.br.com.megajogos.mobile: location5: null 2023-01-09 19:31:38.385 6368-6368/air.br.com.megajogos.mobile I/air.br.com.megajogos.mobile: location6: null 2023-01-09 19:31:38.387 6368-6368/air.br.com.megajogos.mobile I/air.br.com.megajogos.mobile: location7: null 2023-01-09 19:31:38.390 6368-6368/air.br.com.megajogos.mobile I/air.br.com.megajogos.mobile: location8: null 2023-01-09 19:31:38.417 6368-6368/air.br.com.megajogos.mobile I/air.br.com.megajogos.mobile: asset pack name: audioAssetPack
Hello, I couldn't figure out how to use getAssetAbsolutePath
to get the absolute path for a directory. The params are a1
and a2
. I tried a1 as the asset pack's ID and a2 as the relative folder's path but got null
return value. (It works if this is a file)
I know that I could simply get the location of the Asset Pack and then do a string concat. But I'm actually trying to use it to determine if a folder exists in a Asset Pack.
What happens with the iOS app or winApp? Our game is multiplatform we have to do a diferent code for iOS and Android?
Could you please provide a complete example with on-demand asset?
From #18 ...
The PlayAssetDeliveryEvent events are also somehow heretic... I wanted first fetch the fast-follow assets and then fetch the on-demand assets... it goes ok with the first pack, but when I call assets.fetchAssetPack("asset_pack3"); when I receive PlayAssetStatus.COMPLETED then I receive the COMPLETED event for the fast pack with each on-demand pack event. It looks that the closed source is maybe reporting status for all packs with every internal change. But that should be maybe as a separate issue.
My code looks like:
case PlayAssetStatus.COMPLETED:
{
if(event.assetPackName == "asset_pack2") {
log("status asset_pack2: "+ assets.getAssetPackStatus("asset_pack2")); // always zero!!!
log("absolutePath: "+ assets.getAssetAbsolutePath("asset_pack2", "Start.lvl")); // OK
// we have the fast follow assets, so let's download the rest!
log("\non-demand assets =====================================");
assets.fetchAssetPack("asset_pack3");
} else {
log("status asset_pack3: "+ assets.getAssetPackStatus("asset_pack3")); // always zero!!!
log(assets.getAssetAbsolutePath("asset_pack3", "Univerzal.lvl")); // OK
// stop resolving any other events as we are done!
assets.removeEventListener( PlayAssetDeliveryEvent.PLAY_ASSET_UPDATE, playAssetDelivery_statusHandler );
}
break;
}
Probably an issue with event handling given the recent re-architecture away from using a singleton within the SWC...
I am using "install-time
" method, but _assets.openInstallTimeAsset("path/example.txt")
returns null. I have checked the aab file but did not any my data in it. Below is the link to aab file.
<assetPack delivery="install-time" folder="LocalData" id="Swfs"/>
https://drive.google.com/file/d/1GX400f_u_b-ckKEL-E9cQRrrH_vhyttQ/view?usp=sharing
Just thought that it could be helpful for the developers to understand the integration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.