执行失败的任务':arcore_flutter_plugin:compiledebugkotlin'在颤抖中

发布于 2025-01-21 13:17:59 字数 1063 浏览 2 评论 0原文

我想将Arcore插件在颤音中使用,但有此错误。

在调试模式下启动lib \ main.dart在Pixel 2 XL上... lib \ main.dart:1 e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (245, 38) :对象不是抽象的,也不实现抽象成员公共抽象的娱乐效果(P0:活动,P1:捆绑包?):在Android.app.application.Application.activity.activityLifecyClecallbacks中定义的单位 e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\android\src\main\kotlin\com\difrancescogianmarco\arcore_flutter_plugin\ArCoreView.kt: (246, 13) :'on Activitive created'没有覆盖

失败:构建失败而异常。

出了什么问题: 执行失败的任务':arcore_flutter_plugin:compiledebugkotlin'。

编译误差。有关更多详细信息,请参见日志

尝试: 使用-StackTrace选项运行以获取堆栈跟踪。使用-Info或 - debug选项运行,以获取更多日志输出。运行 - 扫描以获得完整的见解。

构建在1M 17s中失败 例外:Gradle Task汇编攻击失败,出口代码1

有人可以帮助我解决这个问题

I want to use Arcore plugin in Flutter but it had this error.

Launching lib\main.dart on Pixel 2 XL in debug mode...
lib\main.dart:1
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\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:\src\flutter.pub-cache\hosted\pub.dartlang.org\arcore_flutter_plugin-0.0.11\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 17s
Exception: Gradle task assembleDebug failed with exit code 1

Can someone help me to solve this please

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

憧憬巴黎街头的黎明 2025-01-28 13:18:00

您是否为Arcode软件包添加了一些配置?
(顺便说一句,此插件只能在Android中使用。如果您在iOS设备上进行测试,则无法使用)

修改您的AndroidManifest.xml以包含以下条目:

<uses-permission android:name="android.permission.CAMERA" />

<!-- Limits app visibility in the Google Play Store to ARCore supported devices
     (https://developers.google.com/ar/devices). -->
<uses-feature android:name="android.hardware.camera.ar" />

<application …>
    …

    <!-- "AR Required" app, requires "Google Play Services for AR" (ARCore)
         to be installed, as the app does not include any non-AR features. -->
    <meta-data android:name="com.google.ar.core" android:value="required" />
</application>

然后,确保您的应用至少具有所需的Minsdkversion在您的应用程序的build.gradle中:

android {
    defaultConfig {
        …
        minSdkVersion 24
    }
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

添加最新的Arcore库作为应用程序build.gradle文件中的依赖项:

dependencies {
    implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.8.0'
    implementation 'com.google.ar:core:1.30.0'
}

Did you add some configurations for arcode package;
(By the way, this plugin can be used just in android. if you are testing on ios device, it's not gonna work)

Modify your AndroidManifest.xml to include the following entries:

<uses-permission android:name="android.permission.CAMERA" />

<!-- Limits app visibility in the Google Play Store to ARCore supported devices
     (https://developers.google.com/ar/devices). -->
<uses-feature android:name="android.hardware.camera.ar" />

<application …>
    …

    <!-- "AR Required" app, requires "Google Play Services for AR" (ARCore)
         to be installed, as the app does not include any non-AR features. -->
    <meta-data android:name="com.google.ar.core" android:value="required" />
</application>

Then, ensure that your app has at least the required minSdkVersion in your app's build.gradle:

android {
    defaultConfig {
        …
        minSdkVersion 24
    }
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

Add the latest ARCore library as a dependency in your app's build.gradle file:

dependencies {
    implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.8.0'
    implementation 'com.google.ar:core:1.30.0'
}
晒暮凉 2025-01-28 13:18:00

如果执行上述操作仍然失败并显示CompileDeBugkotlin错误,那么这应该完成作业

找到解决方案,请修改两个文件打击。
我不知道科特林,但基本上这是一个无效的问题。 @giandifra
../arcore_flutter_plugin-master/android/src/main/kotlin/com/difrancescogianmarco/arcore_flutter_plugt_plugin/arcoreviewfactory.kt
第14行
替代娱乐创建(上下文:上下文,id:int,args:whit?):platformView {

覆盖

有趣的创建(上下文:context?id:int:int,args: ny
返回ArcoreFaceView(活动,上下文,Messenger,ID,DEBUG)

返回

ArcoreFaceView(活动,上下文!,Messenger,ID,DEBUG)

第28行
ArcoreAugmentedImagesView(活动,上下文,Messenger,ID,使用ingleimage,debug)

返回
返回ArcoreAugmentedImagesView(活动,上下文!,Messenger,ID,使用林语,调试)

第30行
ArcoreAugmentedImagesView(活动,上下文,Messenger,ID,使用ingleimage,debug)

返回
返回ArcoreAugmentedImagesView(活动,上下文!,Messenger,ID,使用debug,debug)

../

arcore_flutter_plugter_plugin -master/android/src/src/main/kotlin/kotlin/com/com/difrancescogianmarco/arcore_flutter_flutter_plutter_plutter_plugtin/arcoreflutth/arcoreflutterplutterpluttlpluttlutplutplugtlugtlugtugin.kt list 32。

If doing the above still fails and shows CompileDebugKotlin error then this should finish the job

Found a solution, modify two files blow.
I don't know kotlin, but basically it is a nullable problem. @giandifra
../arcore_flutter_plugin-master/android/src/main/kotlin/com/difrancescogianmarco/arcore_flutter_plugin/ArCoreViewFactory.kt
line 14 from
override fun create(context: Context, id: Int, args: Any?): PlatformView {

to

override fun create(context: Context?, id: Int, args: Any?): PlatformView {

line 25 from
return ArCoreFaceView(activity, context, messenger, id, debug)

to

return ArCoreFaceView(activity, context!!, messenger, id, debug)

line 28 from
return ArCoreAugmentedImagesView(activity, context, messenger, id, useSingleImage, debug)

to
return ArCoreAugmentedImagesView(activity, context!!, messenger, id, useSingleImage, debug)

line 30 from
return ArCoreAugmentedImagesView(activity, context, messenger, id, useSingleImage, debug)

to
return ArCoreAugmentedImagesView(activity, context!!, messenger, id, useSingleImage, debug)

../arcore_flutter_plugin-master/android/src/main/kotlin/com/difrancescogianmarco/arcore_flutter_plugin/ArcoreFlutterPlugin.kt

line 32 from
.registerViewFactory(CHANNEL_NAME, ArCoreViewFactory(registrar.activity(), registrar.messenger()))

to

.registerViewFactory(CHANNEL_NAME, ArCoreViewFactory(registrar.activity()!!, registrar.messenger()))

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文