elimu-ai / vitabu

📚 Android application for reading storybooks and expanding word vocabulary.
MIT License
3 stars 3 forks source link

Handle failing TTS initialization #102

Open jo-elimu opened 11 months ago

jo-elimu commented 11 months ago

The app crashes on Android API 33 running English as the system version:

Process: ai.elimu.vitabu.debug, PID: 30048
java.lang.RuntimeException: Unable to create application ai.elimu.vitabu.BaseApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.speech.tts.TextToSpeech.isLanguageAvailable(java.util.Locale)' on a null object reference
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7264)

Implement a solution the prevents the app from crashing when there is a problem with loading the TTS engine.