Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not resolve import javafx.util.Pair in android studio

I am not able to resolve the issue javafx. When I import this package it is showing can't resolve javafx.util.pair. while I have configured properly in gradle its working in other's system.

like image 530
Gyan Awasthi1 Avatar asked Oct 19 '18 12:10

Gyan Awasthi1


People also ask

Does OpenJDK 8 include JavaFX?

JavaFX (OpenJFX) In 2018, Oracle decided to decouple JavaFX from the JDK. JavaFX lives on as OpenJFX, an OpenJDK subproject. As JavaFX is no longer part of OpenJDK, AdoptOpenJDK does not bundle it with its binaries.


1 Answers

This is because javafx.util.Pair is not a part of OpenJDK which is distributed and used by Android Studio. You need to use Oracle JDK which include JavaFX where it contains javafx.util.Pair. Try to change your Android Studio JDK from your setting.

Or alternatively, you can use Map.Entry or using android.util.Pair

like image 175
ישו אוהב אותך Avatar answered Sep 30 '22 03:09

ישו אוהב אותך