Skip to content

Commit

Permalink
fix(android): java.lang.NoClassDefFoundError error (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecc521 authored Aug 2, 2023
1 parent c329bb2 commit a3d2add
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.getcapacitor.JSArray;
import com.getcapacitor.JSObject;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Locale;
Expand Down Expand Up @@ -122,8 +123,14 @@ public ArrayList<Voice> getSupportedVoicesOrdered() {
orderedVoices.add(supportedVoice);
}

Comparator<Voice> voiceComparator = Comparator.comparing(v -> v.hashCode());
orderedVoices.sort(voiceComparator);
Collections.sort(
orderedVoices,
new Comparator<Voice>() {
public int compare(Voice v1, Voice v2) {
return v1.hashCode() - v2.hashCode();
}
}
);

return orderedVoices;
}
Expand Down

0 comments on commit a3d2add

Please sign in to comment.