英文:
Agconnect - API 'android.registerTransform' is removed
问题
在迁移到Gradle 8.x后,由于最新的华为AppGallery依赖项com.huawei.agconnect:agcp:1.9.0.300
仍然与Gradle 8不兼容,我无法构建该应用程序。
那么,除了回退到Gradle 7之外,是否有其他解决方案?
在项目':app'上应用插件时出现问题。
> 无法应用插件'com.huawei.agconnect'。
> API 'android.registerTransform'已被删除。
有关更多信息,请参阅https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-api。
要确定是什么调用了android.registerTransform,请在命令行上使用-Pandroid.debug.obsoleteApi=true以显示更多信息。
<details>
<summary>英文:</summary>
After migrating to gradle 8.x, I can't build the app because the latest Huawei AppGallery dependency ```com.huawei.agconnect:agcp:1.9.0.300``` still not compatible with gradle 8.
So is there any solutions other than reverting to gradle 7 ?
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.huawei.agconnect'.
> API 'android.registerTransform' is removed.
For more information, see https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-api.
To determine what is calling android.registerTransform, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
</details>
# 答案1
**得分**: 3
终于在[这里](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-common-faq-0000001063210244#section17273113244910)找到了解决方案。
只需将此属性添加到 ```gradle.properties``` 文件中:
```apmsInstrumentationEnabled=false```
<details>
<summary>英文:</summary>
Finally I found the solution [here](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-common-faq-0000001063210244#section17273113244910)..
Just add this property to ```gradle.properties```
apmsInstrumentationEnabled=false
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论