简体   繁体   English

如何使用Flutter插件修复androidX问题?

[英]How to fix androidX issues with Flutter plugins?

I have a flutter project. 我有一个扑朔迷离的项目。 Inside of its "android" folder I have a lot of android code. 在其“ android”文件夹中,我有很多android代码。 I updated this code to use the new androidX packages. 我更新了此代码以使用新的androidX包。

Now, some of the plugins stopepd working. 现在,某些插件将停止运行。 A example is the permission_handler plugin. 一个示例是permission_handler插件。

permissionhandler\PermissionHandlerPlugin.kt: (10, 31): Unresolved reference: ActivityCompat
permissionhandler\PermissionHandlerPlugin.kt: (11, 27): Unresolved reference: content
permissionhandler\PermissionHandlerPlugin.kt: (152, 37): Unresolved reference: ContextCompat
permissionhandler\PermissionHandlerPlugin.kt: (191, 20): Unresolved reference: ActivityCompat
permissionhandler\PermissionHandlerPlugin.kt: (235, 13): Unresolved reference: ActivityCompat

This is probably caused by the removal of old support library and upgrading it to the new androidX. 这可能是由于删除了旧的支持库并将其升级到新的androidX引起的。 How to fix this ? 如何解决呢?

Flutter doesn't officially support AndroidX, but it's on their todo list . Flutter并不正式支持AndroidX,但在他们的待办事项清单上

You'd have to make updates to the plugins themselves to use AndroidX (which I've done for a few items). 您必须对插件本身进行更新才能使用AndroidX(我已经完成了几项)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM