-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any proper example on how to use PlayAssetDelivery (How to pack asset packs)? #21
Comments
I managed to publish the APK file successfully, but the .aab file isn't generated. Thanks in advance. |
Animate doesn't (yet?) directly support Android App Bundles, so you could use the command line, or you could look at the workaround option: https://airsdk.dev/docs/tutorials/platform/android/packaging-android-app-bundles#ides-without-aab-option |
Thank you very much, I appreciate the quick response. |
I don't understand what am I doing wrong, here are the steps I follow: The path I provide in openInstallTimeAsset is the relative to asset pack folder(lets say assets/), not including that i.e (sounds/file.mp3). Thank you in advance. |
Just checking, have you added the extra services that are required for this in the manifest additions in your app descriptor file? See the "Configure the application" section of the wiki: |
Yes, I copied that section from there and added the extensionIds as well. |
Here is the section for android: <android>
<assetPacks>
<assetPack delivery="install-time" folder="assets/" id="soundAssets"/>
</assetPacks>
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<uses-sdk android:minSdkVersion="22" android:targetSdkVersion="33" />
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<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"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<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>
</manifest>]]>
</manifestAdditions>
</android>
<versionLabel>1.3.1</versionLabel>
<supportedLanguages>en</supportedLanguages>
<extensions>
<extensionID>com.harman.PlayAssetDelivery</extensionID>
<extensionID>com.google.android.play</extensionID>
</extensions> |
Documentation might need a slight update (I'll look into it) but the minimum manifest additions should look like this: <manifest android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" />
<!-- Permission will be merged into the manifest of the hosting app. -->
<!-- Is required to launch foreground extraction service for targetSdkVersion 28+. -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!-- Is required to launch foreground extraction service for targetSdkVersion 34+. -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<!-- Required permission for App measurement to run. -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission
android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
<!-- Required by older versions of Google Play services to create IID tokens -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application>
<!-- The activities will be merged into the manifest of the hosting app. -->
<activity android:name="com.google.android.play.core.common.PlayCoreDialogWrapperActivity"
android:exported="false" android:stateNotNeeded="true"
android:theme="@style/Theme.PlayCore.Transparent" />
<!-- The services will be merged into the manifest of the hosting app. -->
<service android:name="com.google.android.play.core.assetpacks.AssetPackExtractionService"
android:enabled="false" android:exported="true">
<meta-data android:name="com.google.android.play.core.assetpacks.versionCode"
android:value="20201" />
</service>
<service android:name="com.google.android.play.core.assetpacks.ExtractionForegroundService"
android:enabled="false" android:exported="false" android:foregroundServiceType="dataSync" />
<receiver android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true" android:exported="false" />
<service android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true" android:exported="false" />
<service android:name="com.google.android.gms.measurement.AppMeasurementJobService"
android:enabled="true" android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:exported="false" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<service android:name="com.google.firebase.components.ComponentDiscoveryService"
android:exported="false">
<meta-data
android:name="com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar"
android:value="com.google.firebase.components.ComponentRegistrar" />
</service>
</application>
</manifest> And you'll need the following extensions: <extensions>
<extensionID>com.distriqt.playservices.Base</extensionID>
<extensionID>com.google.android.play</extensionID>
<extensionID>com.harman.PlayAssetDelivery</extensionID>
<extensionID>com.jetbrains.kotlin</extensionID>
</extensions> Highly recommend using
|
Hello and thank you for your response. |
I did everything above and still getting the same error: sample code: var assets:PlayAssetDelivery = App.Instance.GetAssets();
if (assets == null)
{
trace("PlayAssetDelivery is null!");
}
var strPath:String = assets.getAssetAbsolutePath("soundAssets", soundId);
trace("strPath: " + strPath); // path is null here....
var soundBytes:ByteArray = new ByteArray();
var asset:AssetFile = assets.openInstallTimeAsset(soundId); asset is null here!!! |
Any suggestions? |
What does |
GetAssets() returns the initialized PlayAssetDelivery. |
Here is the log, i hope it helps. |
Hmm - I'm wondering if this is due to some versioning mismatches...
Can I check which version of the Play Asset Delivery ANE you have, and of the com.google.android.play.ane one too? If you open the .ane files within a zip manager and look for "META-INF/ANE/extension.xml", you should see a "versionNumber" field. In our version 9, we updated to use the @marchbold are you able to confirm whether there's a particular version of the play ANE that would be needed to correspond with this? Or is it more that we would need to also specify a Gradle dependency upon a GMS package within the ANE platform file? (there wasn't anything in the migration steps for this .. but reading between the lines, I would think that we perhaps need this too..?) |
Update -> we maybe need to include a dependency on
Let me get that updated and see whether it helps. FYI we were also trying to get our test app into a suitable state for publishing as sample code, but running into some "interesting" issues with Android platform (compile sdk level) 34... |
@hantouan are you able to try with the attached ANE please? (this is zipped up, so unzip it to get at the .ane file) thanks |
I will try that in the morning, can't do that right now |
The ANE versionNumber is 9 |
This would indicate you are missing the https://github.com/airsdk/ANE-PlayAssetDelivery/wiki/Get-Started |
Still getting the same errors. |
Did you grab the latest release? |
Yes, everything are the latest from https://github.com/airsdk/ANE-PlayAssetDelivery/wiki/Get-Started, except the PlayAssetDelivery.ane that I downloaded from the link above (version 10). Is there a chance that I have made errors while packaging the app? The steps I followed are:
and finally |
Ah .. so, trying it here, and it looks like it doesn't work if we have that dependency just included in the grade build file for the ANE code itself... we need that to be included within the main application that links in the ANE. So we would need to switch to add this gradle dependency into the ANE as a separate (XML-based) dependency rather than having this in the ANE java build configuration. .... will get an updated version prepared and hopefully check it here before posting, we've managed to get a reproduction of the issue I think.. |
@hantouan please try with this ANE file: To install it, you can use ADT:
because internally that would just do the same as the two bundletool commands (assuming bundletool already knows about your keystore, i.e. if you've ever built any debug stuff in Android Studio..) FYI we've also put our test case now up online: thanks |
I built and run the test case and it seems it works, but not for install-time assets, here is the output: ANE is supported Checking status for install-time asset pack Could not read install-time asset file Checking status for asset pack: fast_follow_asset_pack Asset pack not found: requesting Status event -> fast_follow_asset_pack, 1 Status event -> fast_follow_asset_pack, 2 Download Progress = 50% Status event -> fast_follow_asset_pack, 3 Transfer Progress = 0% Status event -> fast_follow_asset_pack, 4 Status event -> fast_follow_asset_pack, 4 Checking status for asset pack: on_demand_asset_pack Asset pack not found: requesting Status event -> on_demand_asset_pack, 1 Status event -> on_demand_asset_pack, 2 Download Progress = 0% Status event -> on_demand_asset_pack, 3 Transfer Progress = 0% Status event -> on_demand_asset_pack, 4 Status event -> on_demand_asset_pack, 4 |
Did you install the bundle via ADT? I think your manual bundletool usage is missing the "local testing" flag. If it's not working after adding that, can you capture logcat output for it (either from Android Studio / ADB, or thanks |
I used adt this time. |
That's odd .. nothing massively obvious in the log but the test case works for me. Can I suggest uninstalling the app from your phone and rebooting it? then re-install.. (and maybe even change the application ID?) - potentially it got into a weird scenario with the older version and maybe didn't install the install-time APK properly.... thanks |
Same thing :). I have also changed the ID. |
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
The text was updated successfully, but these errors were encountered: