Android DeepLinkDispatch-不兼容类型:列表<;对象>;无法转换为列表<;DeepLinkEntry>;

Android DeepLinkDispatch-不兼容类型:列表<;对象>;无法转换为列表<;DeepLinkEntry>;,android,Android,以下是关于“我拥有”的教程: 添加到我的项目的父级build.gradle: dependencies { classpath 'com.android.tools.build:gradle:2.3.0' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' <--- // NOTE: Do not place your application dependencies her

以下是关于“我拥有”的教程:

添加到我的项目的父级
build.gradle

dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' <---

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
apply plugin: 'com.neenbedankt.android-apt'

...

compile 'com.airbnb:deeplinkdispatch:3.0.0'
apt 'com.airbnb:deeplinkdispatch-processor:3.0.0'
创建模块类并对其进行注释:

@DeepLinkModule
public class AppDeepLinkModule
{

}
现在,当我尝试构建时,它会显示上面的错误消息:

Error:(12, 82) error: incompatible types: List<Object> cannot be converted to List<DeepLinkEntry>
DeepLinkActivity

@DeepLinkHandler({AppDeepLinkModule.class})
public class DeepLinkActivity extends AppCompatActivity
{
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
    }
}

如何修复此问题?

您是否尝试过简单的强制转换

(列表)

我是说
publicstaticfinallist注册表=(List)集合。不可修改列表(Arrays.asList)(

)); 当应用程序未指定任何深度链接目标时,就会出现此问题。在这种情况下,代码生成器将创建一个空列表,这将引发编译器错误

您可以通过使用
@DeepLink
注释类(例如
活动
)从语法上解决此问题:

@DeepLink(“scheme://authority")
公共类TargetActivity扩展了活动{
}

代码生成器将向该列表中添加一个元素。

我遇到了这个错误:
未找到id为'com.neenbedankt.android apt'的插件。
@nandsito在项目
build.gradle
中需要添加以下行:
classpath'com.neenbedankt.gradle.plugins:android apt:1.8'
{
。我会编辑这个问题。我看到你在github上打开了一个问题。如果问题真的是我在回答中提到的,我想他们应该真的解决它!看起来像是不完整的文档。谢谢你的帮助,非常感谢。我真的不喜欢编辑自动生成的文件。但是,我尝试了这个,它给了我一个错误:
Inconvertible类型;无法将“java.util.List”强制转换为“java.util.List”
<activity
        android:name=".deeplink.DeepLinkActivity"
        android:theme="@android:style/Theme.NoDisplay">
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>

            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>

            <data
                android:host="slackwebsocket"
                android:scheme="http"/>
        </intent-filter>
    </activity>
@DeepLinkHandler({AppDeepLinkModule.class})
public class DeepLinkActivity extends AppCompatActivity
{
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
    }
}