Это сообщение, которое показывает консоль.
Process: com.example.claseandroid, PID: 8609
java.lang.NoSuchMethodError: No static method metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; in class Ljava/lang/invoke/LambdaMetafactory; or its super classes (declaration of 'java.lang.invoke.LambdaMetafactory' appears in /apex/com.android.runtime/javalib/core-oj.jar)
at okhttp3.internal.Util.<clinit>(Util.java:87)
at okhttp3.internal.Util.skipLeadingAsciiWhitespace(Util.java:321)
at okhttp3.HttpUrl$Builder.parse(HttpUrl.java:1313)
at okhttp3.HttpUrl.get(HttpUrl.java:917)
at retrofit2.Retrofit$Builder.baseUrl(Retrofit.java:492)
at com.example.claseandroid.ConectHeroku.getRetrofit(ConectHeroku.java:12)
at com.example.claseandroid.ConectHeroku.getService(ConectHeroku.java:19)
at com.example.claseandroid.MainActivity.getDataHeroku(MainActivity.java:26)
at com.example.claseandroid.MainActivity.onCreate(MainActivity.java:21)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
Это класс с ошибкой
public static final String herokuLink = "https://mongodev.herokuapp.com/api/";
private static Retrofit getRetrofit(){
return new Retrofit.Builder()
.baseUrl(herokuLink)
.addConverterFactory(GsonConverterFactory.create())
.build();
}
Этот метод имеет интерфейсный класс.
public static routerHeroku getService(){
return getRetrofit().create(routerHeroku.class);
}