Code Monkey home page Code Monkey logo

ane-playassetdelivery's Introduction

AIR SDK logo

Play Asset Delivery ANE

Play Asset Delivery (PAD) brings the benefits of app bundles to games. It allows games larger than 150MB to replace legacy expansion files (OBBs) by publishing a single artifact to Play containing all the resources the game needs. PAD offers flexible delivery modes, auto-updates, compression, and delta patching, and is free to use. Using PAD, all asset packs are hosted and served on Google Play removing the need to use a content delivery network (CDN) to get your game resources to players.

Play Asset Delivery uses asset packs, which are composed of assets (such as textures, shaders, and sounds), but no executable code. Through Dynamic Delivery, you can customize how and when each asset pack is downloaded onto a device according to three delivery modes: install-time, fast-follow, and on-demand.

This AIR native extension brings the ability to access your assets at runtime in your AIR application.

More information on Play Asset Delivery:

ane-playassetdelivery's People

Contributors

marchbold avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

isabella232

ane-playassetdelivery's Issues

fetchAssetPack / getAssetPackStatus / getAssetPackLocation causes released ver. app frozen

@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>

Here's how the App bundle looks in Google Play console:
Screen Shot 2021-12-29 at 4 47 29 PM
Screen Shot 2021-12-29 at 4 49 24 PM

how to use getAssetAbsolutePath

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.

[not issue] examples on how to integrate it with Starling's Asset Manager

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!

Open source this ANE?

Maybe it would be more educative to have real ANE's sources and not just the binary ANE itself, wouldn't it?

Crash From Google Play Store Installation

Expected behaviour

The app should not crash if initializing PlayAssetDelivery or calling its functions fetchAssetPack() or getAssetPackStatus().

Actual behaviour

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.

Environment
  • AIR SDK version: 33.1.1.856
  • Device OS: Android
  • Device version: 11
  • Development IDE: Flash Builder
  • Development OS: Windows 10
Logs

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:

  • androidx.core
  • androidx.appcompat
  • com.harman.PlayAssetDelivery
  • com.google.android.play

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]

What happens in iOS or WinApp?

What happens with the iOS app or winApp? Our game is multiplatform we have to do a diferent code for iOS and Android?

Error: Binder died

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.

initAssetDelivery() returns false

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 ?

PlayAssetDelivery event dispatch results in multiple status reports across different asset packs on each change

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...


1120 _assets access of undefined property

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)

		}

Problem to load asset on demand

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

my project structure
Captura

Missing PlayAssetDeliveryEvent Class

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!

program stopped execution when calling getAssetPackStatus/getTotalBytesToDownLoad/getByteDownloaded

@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)

  1. I also tried to call fetchAssetPack first, and it also stops my program.
  2. I checked the aab package in Android Studio and I could see the ap_assets_one package.
  3. I use logcat with filter distriqt|AndroidRuntime|System.err, and I'm not seeing any error outputs.

Screen Shot 2021-12-22 at 2 44 05 PM

Screen Shot 2021-12-22 at 2 45 11 PM

Thanks in advance!

Request to PGS failed because all packs are unavailable.

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"

AppendBytes and mp4?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.