Following the tutorial on the github page I have:
added to my project's parent 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
}
added to my app's build.gradle
:
apply plugin: 'com.neenbedankt.android-apt'
...
compile 'com.airbnb:deeplinkdispatch:3.0.0'
apt 'com.airbnb:deeplinkdispatch-processor:3.0.0'
Created a module class and annotated it:
@DeepLinkModule
public class AppDeepLinkModule
{
}
Now when I try to build, it displays the above error message:
Error:(12, 82) error: incompatible types: List<Object> cannot be converted to List<DeepLinkEntry>
It then points me towards this class which is autogenerated:
public final class AppDeepLinkModuleLoader implements Parser {
public static final List<DeepLinkEntry> REGISTRY = Collections.unmodifiableList(Arrays.asList(
)); <-- this line here
@Override
public DeepLinkEntry parseUri(String uri) {
for (DeepLinkEntry entry : REGISTRY) {
if (entry.matches(uri)) {
return entry;
}
}
return null;
}
}
I've referred to their sample app and mine seems identical. Here is a link to their class which does the same thing.
I completed further steps until I need to use the autogenerated class in case this was the issue but this didn't fix things either. AndroidManifest.xml
:
<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>
DeepLinkActivity
:
@DeepLinkHandler({AppDeepLinkModule.class})
public class DeepLinkActivity extends AppCompatActivity
{
@Override
protected void onCreate(@Nullable Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
}
}
How do I fix this?
This problem occurs when the application doesn't specify any deep link targets. In this case the code generator creates an empty list, which raises the compiler error.
You can syntactically fix this issue by annotating a class, e.g. an Activity
, with @DeepLink
:
@DeepLink("scheme://authority")
public class TargetActivity extends Activity {
}
The code generator will add an element to that list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With