AR 核心在 ar_core 模块颤振中出错 [英] AR core giving error in ar_core module flutter

查看:21
本文介绍了AR 核心在 ar_core 模块颤振中出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是颤振的新手.我正在使用谷歌提供的 AR 核心.但我在编译时收到此错误:

I am new to flutter. I am using AR core provided by google. But I get this error at compiletime:

flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.10\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (241, 38): 对象不是抽象且不实现抽象成员 public abstract fun onActivityCreated(@NonNull p0: Activity, @Nullable p1: Bundle?): android.app.Application.ActivityLifecycleCallbacks 中定义的单元

flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.10\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (241, 38): Object is not abstract and does not implement abstract member public abstract fun onActivityCreated(@NonNull p0: Activity, @Nullable p1: Bundle?): Unit defined in android.app.Application.ActivityLifecycleCallbacks

您可以在此处

此错误是特定于我的版本还是属性中的错误?我也启用了 AndroidX

is this error specific to my version or is it an error in the properties? Also I have enabled AndroidX

推荐答案

flutter插件有错误需要更正.

There is an error in the flutter plugin that needs to be corrected.

转到 Flutter 插件中的 ArCoreView.kt 文件

Go to ArCoreView.kt file in Flutter plugin at

\flutter.pub-cache\hosted\pub.flutter-io.cn\arcore_flutter_plugin-0.0.10\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin

\flutter.pub-cache\hosted\pub.flutter-io.cn\arcore_flutter_plugin-0.0.10\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin

删除?"从 onActivityCreated 如下

remove "?" from onActivityCreated as below

即替换

override fun onActivityCreated( activity: Activity?, savedInstanceState: Bundle? )

通过

override fun onActivityCreated( activity: Activity, savedInstanceState: Bundle? )

这解决了我的问题

这篇关于AR 核心在 ar_core 模块颤振中出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆