如何使 AR Core flutter 插件正常工作?
我正在尝试在我的 flutter 应用程序中使用 AR。我正在使用包 arcore_flutter_plugin
。 添加插件后,我无法运行该应用程序,并且收到此错误(在禁用空安全功能后):
e: C:\Users\LENOVO THINKPAD\OneDrive\Bureau\Hackathon\ar_test\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (245, 38): Object is not abstract and does not implement abstract member public abstract fun onActivityCreated(p0: Activity, p1: Bundle?): Unit defined in android.app.Application.ActivityLifecycleCallbacks
e: C:\Users\LENOVO THINKPAD\OneDrive\Bureau\Hackathon\ar_test\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (246, 13): 'onActivityCreated' overrides nothing
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'.
> Compilation error. See log for more details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 57s
有人可以帮助我使其工作吗?
I'm trying to use AR in my flutter app. I'm using the package arcore_flutter_plugin
.
After adding the plugin, I'm unable to run the app and I get this error (after having disabled the null safety feature) :
e: C:\Users\LENOVO THINKPAD\OneDrive\Bureau\Hackathon\ar_test\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (245, 38): Object is not abstract and does not implement abstract member public abstract fun onActivityCreated(p0: Activity, p1: Bundle?): Unit defined in android.app.Application.ActivityLifecycleCallbacks
e: C:\Users\LENOVO THINKPAD\OneDrive\Bureau\Hackathon\ar_test\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (246, 13): 'onActivityCreated' overrides nothing
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':arcore_flutter_plugin:compileDebugKotlin'.
> Compilation error. See log for more details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 57s
Can someone help me make it work ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是arcore_flutter_plugin 中的错误。
导航到 ArCoreView.kt 文件:
从以下行中删除 '?': 换行
:
This is an error in the arcore_flutter_plugin.
Navigate into the ArCoreView.kt file:
Remove '?' from the following line:
New-line:
我也发现同样的错误
flutter 项目出错
通过更改 MotionEvent 修复了哪些问题? ---> MotionEvent更改ArCoreView.kt的代码之前
这张图片显示了我所做的更改
I also found the same error,
Error in flutter project
which was fixed by changing MotionEvent? ---> MotionEventBefore changing the code of ArCoreView.kt
This the image that shows the changes I have made