1

I'm trying to build a Unity app that uses an Android library. The library code makes use of the Pair class, the code snippet is the following:

private Pair<Connection, Connection[]> parseConnectionOptions(Connection connDefault) throws ConfigParseError {
    Connection conn;
    if (connDefault != null)

I generate a java library (aar) and use it from my Unity app. However when I build the app and try to run it I get the following error

11-29 13:17:25.166 19667 19701 E Unity   : AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/util/Pair;
11-29 13:17:25.166 19667 19701 E Unity   : java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/util/Pair;

I've already investigated if there's some similar issue but didn't found any useful information. I don't understand why this class is missing. Any hints are more than welcome.

rkachach
  • 16,517
  • 6
  • 42
  • 66
  • Do you have a typo in your import statement? That `L` shouldnt be there – f1sh Nov 29 '21 at 12:26
  • No, I think the "L" is inserted by the exception handles. The code at Android builds correctly it fails on runtime. – rkachach Nov 29 '21 at 12:27
  • Does this answer your question? [java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/app/ActivityManagerCompat](https://stackoverflow.com/questions/53141800/java-lang-noclassdeffounderror-failed-resolution-of-landroidx-core-app-activit) – f1sh Nov 29 '21 at 12:52
  • 1
    Unfortunately no because the missing class is different. – rkachach Nov 29 '21 at 12:56
  • @rkachach Were you able to resolve this? I'm currently facing same issue – olajide Feb 19 '22 at 18:20
  • unfortunately I don't remember how I fixed it. I think it just disappeared once I moved to a higher API level but not sure to be honest. – rkachach Feb 21 '22 at 09:12

0 Answers0