英文:
Play Asset Delivery Android resource linking failed - Execution failed for task :app:linkDebugManifestForAssetPacks
问题
I'm trying to build a soundboard app. I have lots of sounds to deploy so I decided to use Play Asset Delivery. I followed the instructions in the Google's guide.
-
I created an asset pack folder in the top level and named it sounds. This is how my project looks
Project structure:
This is the
build.gradle
file in the sounds directory:apply plugin: 'com.android.asset-pack' assetPack { packName = "sounds" // Directory name for the asset pack dynamicDelivery { deliveryType = "[install-time]" } }
-
Updated my app build.gradle file:
android { ... assetPacks = [":sounds"] }
and my settings.gradle file:
include ':app' include ':sounds'
-
Placed the assets in the sounds/src/main/assets.
When I try to build the bundle, I keep getting this error:
Gradle Error:
This is the Manifest in the sounds folder:
Manifest with errors:
I tried cleaning the project, invalidating caches, and restarting, but nothing seems to work.
英文:
I'm trying to build a soundboard app. I have lots of sounds to deploy so I decided to use Play Asset Delivery. I followed the instructions in the Google's guide.
-
I created an asset pack folder in the top level and named it sounds. This is how my project looks
Project structure:
<br>
This is the build.gradle
file in the sounds directory
apply plugin: 'com.android.asset-pack'
assetPack {
packName = "sounds" // Directory name for the asset pack
dynamicDelivery {
deliveryType = "[install-time]"
}
}
<br>
-
Updated my app build.gradle file
android { . . . assetPacks = [":sounds"] }
and my settings.gradle file
include ':app'
include ':sounds'
<br>
- Placed the assets in the sounds/src/main/assets
When I try to build the bundle I keep getting this error
Gradle Error:
This is the Manifest in the sounds folder
Manifest with errors:
I tried cleaning the project, invalidating caches and restarting but nothing seems to work.
答案1
得分: 6
After spending so many hours I managed to build the bundle successfully.
Simply remove brackets from your asset folder's build.gradle file
deliveryType = "install-time"
This is Google's example code for Play Asset Delivery
// In the asset pack's build.gradle file:
apply plugin: 'com.android.asset-pack'
assetPack {
packName = "asset-pack-name" // Directory name for the asset pack
dynamicDelivery {
deliveryType = "[ install-time | fast-follow | on-demand ]"
}
}
I thought deliveryType = "[install-time]" would be the correct syntax. After comparing my asset pack manifest with a dynamic feature's manifest I realized gradle produces a wrong dist attribute.
This is what i got for writing deliveryType with brackets
This is the correct syntax in the dynamic feature's manifest
<dist:on-demand />
Removing brackets did the trick. Hope it helps someone.
英文:
After spending so many hours I managed to build the bundle successfully.
Simply remove brackets from your asset folder's build.gradle file
deliveryType = "install-time"
<br>
<br>
This is Google's example code for Play Asset Delivery
// In the asset pack’s build.gradle file:
apply plugin: 'com.android.asset-pack'
assetPack {
packName = "asset-pack-name" // Directory name for the asset pack
dynamicDelivery {
deliveryType = "[ install-time | fast-follow | on-demand ]"
}
}
I thought deliveryType = "[install-time]" would be the correct syntax. After comparing my asset pack manifest with a dynamic feature's manifest I realized gradle produces a wrong dist attribute.
This is what i got for writing deliveryType with brackets
<dist:[install-time]/>
This is the correct syntax in the dynamic feature's manifest
<dist:on-demand />
Removing brackets did the trick. Hope it helps someone.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论