小编Tav*_*_PG的帖子

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

我无法编译我的 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
Run Code Online (Sandbox Code Playgroud)

这是一个简单的测试项目,具有最少的代码。与常规 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"/> …
Run Code Online (Sandbox Code Playgroud)

java android kotlin ros android-gradle-plugin

3
推荐指数
1
解决办法
5821
查看次数

标签 统计

android ×1

android-gradle-plugin ×1

java ×1

kotlin ×1

ros ×1