Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Attempting to investigate this myself, in case an expert on the subject isn't around:</p> <p>The NullPointerException stack trace is printed by <code>setEngineByPackageName()</code> itself in the catch handler for this try clause:</p> <pre><code>try { result = mITts.setEngineByPackageName(enginePackageName); if (result == TextToSpeech.SUCCESS){ mCachedParams[Engine.PARAM_POSITION_ENGINE + 1] = enginePackageName; } } </code></pre> <p>Which suggests that either of the following is null:</p> <ol> <li>mITts</li> <li>mCachedParams</li> </ol> <p>mCachedParams is unlikely to be the null one because it is initialized in the constructor. So this leaves us with <code>mITts</code>:</p> <p>If I examine <code>TextToSpeech.initTts()</code> I can easily spot 2 points in which mITts can remain null:</p> <ol> <li>onServiceConnected()</li> <li>onServiceDisconnected()</li> </ol> <p>But why this is happening only on the 2.3.4 device? This is still a mystery.</p> <p>Possible clue: The method <code>TextToSpeech.initTts()</code> ends with the following comment:</p> <pre><code>mContext.bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE); // TODO handle case where the binding works (should always work) but // the plugin fails </code></pre> <p>Which may explain why I receive a barrage of <code>onInit()</code>s ("initTts() successfully bound to service"): Binding always works, but since the package is not installed, "the plugin fails".</p> <p>The question now is how to stop this endless loop...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload