【发布时间】:2021-11-06 05:54:21
【问题描述】:
我最近将我唯一的 cordova 项目转换为使用 Ionic 和 Capacitor。 发布到应用商店发现我的应用太大(aab 格式),因为我的图片太多。 我了解我需要创建一个资产包。关于创建资产包的详细信息,我只能找到https://developer.android.com/guide/playcore/asset-delivery/integrate-native (谁有更好的信息?)。
完成这些步骤后,在 VS Code I ...
> ionic build
> ionic capacitor build
然后在 Android 工作室我做。
Menu | Build | Make Project
我收到以下错误:
Build file 'C:\code\myco-match\android\build.gradle' line: 27
A problem occurred evaluating root project 'android'.
> Could not find method android() for arguments [build_19eh0vogqj489iczcfbatfj08$_run_closure2@69641835] on root project 'android' of type org.gradle.api.Project.
第 27 行是
android {
assetPacks = [":species-images"]
}
我是否遗漏了构建步骤?
我是否在我的 gradle 配置中遗漏了什么?我对 gradle 不是很熟悉)。
我是否在最初的应用转换中忘记了某些内容?这是我的第一个科尔多瓦项目转换为我的第一个离子和电容器项目。
有什么想法吗?
【问题讨论】:
-
我收到了一个错误,资产包名称中包含破折号,如此处所述stackoverflow.com/questions/44531814/android-studio-xml-error/… 不要在包名称中使用破折号!
标签: android-gradle-plugin ionic3 capacitor