0

我在测试继承 android 本机类的自定义 TTS 类时遇到以下异常:

java.lang.UnsupportedOperationException: getNativeBBinderHolder is native
at android.os.Binder.getNativeBBinderHolder(Binder.java)
at android.os.Binder.<init>(Binder.java:597)
at android.os.Binder.<init>(Binder.java:581)
at android.speech.tts.ITextToSpeechService$Stub.<init>(ITextToSpeechService.java:230)
at android.speech.tts.TextToSpeechService$1.<init>(TextToSpeechService.java:1275)
at android.speech.tts.TextToSpeechService.<init>(TextToSpeechService.java:1274)
at com.speech.speechimpl.tts.TtsServiceImplBase.<init>(TtsServiceImplBase.java:11)
at com.speech.assistant.core.impl.tts.TtsServiceImpl.<init>(TtsServiceImpl.java:20)
at com.speech.assistant.core.impl.tts.SpeechImplTest.testSpeechOnStop(SpeechImplTest.java:66)

源代码 - SpeechImplTest.java

Line 66 : mSpeechImpl = new SpeechImpl();
Line 67 : mSpeechImplSpy = spy( mSpeechImpl );

using annotation 
@SuppressStaticInitializationFor({"android.os.SystemProperties","android.os.Binder"})

如何解决这个问题呢?

4

0 回答 0