Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(android) Error: Comparison method violates its general contract! (#…
…114) * fix(android) Error: Comparison method violates its general contract! Fixes a runtime crash on getSupportedVoices observed on Android after changing the default TTS from Samsung to Google from system settings. Stack: @capacitor-community/text-to-speech: 4.0.0, @capacitor/android : 6.0.0 @ionic/angular:7.8.6 Traces: Sending plugin error: {"save":false,"callbackId":"72380935","pluginId":"TextToSpeech","methodName":"getSupportedVoices","success":false,"error":{"message":"Comparison method violates its general contract!"}} * fix(android) Error: Comparison method violates its general contract! revisited This change to the solution keeps the behavior 100% consistent with original code that orders based on hash instead of name Fixes a runtime crash on getSupportedVoices observed on Android after changing the default TTS from Samsung to Google from system settings. Stack: @capacitor-community/text-to-speech: 4.0.0, @capacitor/android : 6.0.0 @ionic/angular:7.8.6 Traces: Sending plugin error: {"save":false,"callbackId":"72380935","pluginId":"TextToSpeech","methodName":"getSupportedVoices","success":false,"error":{"message":"Comparison method violates its general contract!"}} * fix(android) Error: Comparison method violates its general contract! Fixes #112 Changes compare logic to avoid the issue described without changing the ordering behavior. --------- Co-authored-by: Henrique Latorre <[email protected]>
- Loading branch information