airbnb / DeepLinkDispatch

A simple, annotation-based library for making deep link handling better on Android
http://nerds.airbnb.com/deeplinkdispatch/
4.39k stars 406 forks source link

incompatible types: List<Object> cannot be converted to List<DeepLinkEntry> #169

Closed jbmlaird closed 7 years ago

jbmlaird commented 7 years ago

Upon creating a class and annotating it like below

@DeepLinkModule
public class AppDeepLinkModule
{

}

when I try to then build the project I get the error:

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

from the AppDeepLinkModuleLoader class:

public final class AppDeepLinkModuleLoader implements Parser {
  public static final List<DeepLinkEntry> REGISTRY = Collections.unmodifiableList(Arrays.asList(
  )); <--- this line

  @Override
  public DeepLinkEntry parseUri(String uri) {
    for (DeepLinkEntry entry : REGISTRY) {
      if (entry.matches(uri)) {
        return entry;
      }
    }
    return null;
  }
}

I'm using the latest version:

compile 'com.airbnb:deeplinkdispatch:3.0.0'
apt 'com.airbnb:deeplinkdispatch-processor:3.0.0'
jbmlaird commented 7 years ago

nandsito answered this for me over on StackOverflow

It won't compile until you add the @DeepLink annotation to an Activity.

@DeepLink("scheme://authority")
public class TargetActivity extends Activity {
}