为了账号安全,请及时绑定邮箱和手机立即绑定

“无法解析以下类的超类型。” 在任务中:应用程序:buildInfoGeneratorDebug

“无法解析以下类的超类型。” 在任务中:应用程序:buildInfoGeneratorDebug

呼啦一阵风 2023-04-13 14:27:22
我无法编译我的 Android Kotlin 项目,因为在 gradle 编译时出现以下“Kotlin 编译器”错误:Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath: class sensor_msgs.CompressedImage, unresolved supertypes: org.ros.internal.message.Message> Task:app:buildInfoGeneratorDebug这是一个简单的测试项目,只有最少的代码。常规 android 应用程序之间的主要区别。这是我的 MainActivity 使用类 RosActivity 而不是 AppCompatActivity。我已经更改了'ext.kotlin_version'(无法解析以下类的超类型。请确保您在类路径中具有所需的依赖项:)我尝试更改依赖项的顺序(错误:无法解析以下类的超类型。请确保您在类路径中具有所需的依赖项)我试过'resolutionStrategy.force'(错误:无法解析以下类的超类型。请确保您在类路径中具有所需的依赖项)我试过“无效缓存/重新启动”(错误:无法解析以下类的超类型。请确保您在类路径中具有所需的依赖项)我更改了 'org.jetbrains.kotlin:kotlin' 但这没有用(无法解析以下类的超类型)清单.xml:<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"          xmlns:tools="http://schemas.android.com/tools" package="com.company.roscameratest">    <application            android:allowBackup="true"            android:icon="@mipmap/ic_launcher"            android:label="@string/app_name"            android:roundIcon="@mipmap/ic_launcher_round"            android:supportsRtl="true"            android:theme="@style/AppTheme" tools:replace="android:icon">        <activity android:name=".MainActivity">            <intent-filter>                <action android:name="android.intent.action.MAIN"/>                <category android:name="android.intent.category.LAUNCHER"/>            </intent-filter>        </activity>        <activity android:name="org.ros.android.MasterChooser" />        <service android:name="org.ros.android.NodeMainExecutorService" >            <intent-filter>                <action android:name="org.ros.android.NodeMainExecutorService" />            </intent-filter>        </service>    </application></manifest>
查看完整描述

1 回答

?
慕码人8056858

TA贡献1803条经验 获得超6个赞

在gradle中,如果你的项目实现了A,但是A也实现了B。如果你的项目使用了A中的某个类,扩展了B中的类,你可以只调用构造方法,不能调用B中调用superClass的方法,或者使用它方法参数。

只是尝试实现api。

api 'org.ros.android_core:android_15:0.3.3'


查看完整回答
反对 回复 2023-04-13
  • 1 回答
  • 0 关注
  • 245 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信