This function is so crucial. At present our recreation is over 200MB and can’t be uploaded to the shop. I regarded it up and it says that importing is feasible utilizing this function.
I don’t know what a part of cocos creator I want to alter to make this function. When you’ve got any tutorials or movies about this, might you please share them?
You’re our savior who offers solutions.
It’s worthwhile to modify your Android Gradle construct recordsdata to allow the property to be configured as an Asset Pack along with install-time/content material supply plugins
First, create a brand new module to your Android output construct undertaking and transfer the construct property content material (all of your .js .HTML recordsdata folder) to this module /property folder. You have to to create/change the construct.gradle and AndroidManifest recordsdata to your wants
construct.gradle file minimal config:
plugins {
id 'com.android.asset-pack'
}
assetPack {
packName = "{YOUR_MODULE_NAME}"
dynamicDelivery {
deliveryType = "install-time"
}
}
minimal AndroidManifest
The Asset-pack-entry worth right here is the folder title and path for use to find your recreation bundle. android:hasCode=“false” is crucial to outline this as a pure asset bundle and get the 1.5GB restrict to add.
Now, you want to modify the principle app gradle recordsdata and in addition the undertaking settings
on the construct.gradle of the principle app, you will want so as to add a number of strains:
android {
// ... all earlier code
sourceSets.fundamental {
// ... if there's any reference right here to the trail of the construct recordsdata, take away them
}
assetPacks = [":{YOUR_MODULE_NAME}"]
bundle {
language {
enableSplit = true
}
density {
enableSplit = true
}
abi {
enableSplit = true
}
}
}
dependencies {
// ... all earlier dependencies
implementation 'com.google.android.play:asset-delivery:2.2.2'
implementation 'com.google.android.play:feature-delivery:2.1.0'
}
After which in your settings.gradle file for the principle Android undertaking, you must embrace your module
embrace ":{YOUR_MODULE_NAME}"
And that’s it. This ought to be sufficient so that you can work out this downside. Use ChatGPT or comparable in case you caught and ultimately will work.
Thanks a lot to your helpful reply… May you please assist me just a little extra? The construct was profitable thus far, however nothing seems on the display screen.
-
folder tree
-
gradle fiile
-
manifest file
May you please share a screenshot of your undertaking construction?
Sadly, I do not need a undertaking to share beneath this group.
However wanting over the pictures you posted, you ought to be shut.
Did you add this step to your fundamental app (the alcatmist undertaking over your group)? In any other case, the principle app is not going to know this asset pack scope exists.
Take a deep take a look at the Google documentation and use the “Analyze” choice after constructing the .aab file to make sure the bundles had been constructed appropriately.
Additionally, when creating a brand new module utilizing Android Studio, there are a number of choices earlier than asking what this module might be. This may assist configure a number of steps mechanically.