question

sermonaudiodev avatar image
sermonaudiodev asked

NoClassDefFoundError WhisperplayControllerAdaptor$1

I am trying to use the Fire TV SDK with an Android app. I'm trying to use the DiscoveryController to list devices on my network, taken directly from the sample code. I am seeing this error: I/art (23267): Rejecting re-init on previously-failed class java.lang.Class I/art (23267): Rejecting re-init on previously-failed class java.lang.Class Then the app eventually crashes: D/AndroidRuntime(17922): Shutting down VM E/AndroidRuntime(17922): FATAL EXCEPTION: main E/AndroidRuntime(17922): Process: sa.android, PID: 17922 E/AndroidRuntime(17922): java.lang.NoClassDefFoundError: com.amazon.whisperplay.fling.media.controller.impl.WhisperplayControllerAdaptor$1 E/AndroidRuntime(17922): at com.amazon.whisperplay.fling.media.controller.impl.WhisperplayControllerAdaptor. (WhisperplayControllerAdaptor.java:64) E/AndroidRuntime(17922): at com.amazon.whisperplay.fling.media.controller.DiscoveryController.start(DiscoveryController.java:71) E/AndroidRuntime(17922): at com.sermonaudio.android.sermons.fling.saFlingDiscoverService.onStartCommand(saFlingDiscoverService.java:146) Not sure what this means or where to start troubleshooting. AmazonFling.jar is in my "libs" folder. The app compiles, so gradle is finding it.
fire tv
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sermonaudiodev avatar image
sermonaudiodev answered
The previous error messages came from ART. I tried the same APK with Davlik and this is what I see: I/dalvikvm( 3522): Failed resolving Lcom/amazon/whisperplay/fling/media/controller/impl/WhisperplayControllerAdaptor$1; interface 1950 'Lcom/amazon/whisperlink/services/android/WhisperLinkPlatformListener;' W/dalvikvm( 3522): Link of class 'Lcom/amazon/whisperplay/fling/media/controller/impl/WhisperplayControllerAdaptor$1;' failed E/dalvikvm( 3522): Could not find class 'com.amazon.whisperplay.fling.media.controller.impl.WhisperplayControllerAdaptor$1', referenced from method com.amazon.whisperplay.fling.media.controller.impl.WhisperplayControllerAdaptor. W/dalvikvm( 3522): VFY: unable to resolve new-instance 1992 (Lcom/amazon/whisperplay/fling/media/controller/impl/WhisperplayControllerAdaptor$1;) in Lcom/amazon/whisperplay/fling/media/controller/impl/WhisperplayControllerAdaptor; D/dalvikvm( 3522): VFY: replacing opcode 0x22 at 0x0018 W/dalvikvm( 3522): VFY: unable to find class referenced in signature (Lcom/amazon/whisperlink/services/WPServer;) W/dalvikvm( 3522): VFY: unable to find class referenced in signature (Lcom/amazon/whisperlink/services/WPServer;) W/dalvikvm( 3522): VFY: unable to find class referenced in signature (Lcom/amazon/whisperlink/services/WPServer;) I/dalvikvm( 3522): Could not find method com.amazon.whisperlink.services.WPServer.stop, referenced from method com.amazon.whisperplay.fling.media.controller.impl.WhisperplayControllerAdaptor.cleanupCallbackHandler W/dalvikvm( 3522): VFY: unable to resolve virtual method 14317: Lcom/amazon/whisperlink/services/WPServer;.stop ()V D/dalvikvm( 3522): VFY: replacing opcode 0x6e at 0x0005 W/dalvikvm( 3522): VFY: unable to find class referenced in signature (Lcom/amazon/whisperlink/service/Device;) I/dalvikvm( 3522): Could not find method com.amazon.whisperlink.service.Device.getUuid, referenced from method com.amazon.whisperplay.fling.media.controller.impl.WhisperplayControllerAdaptor.deviceAdded W/dalvikvm( 3522): VFY: unable to resolve virtual method 13936: Lcom/amazon/whisperlink/service/Device;.getUuid ()Ljava/lang/String; D/dalvikvm( 3522): VFY: replacing opcode 0x6e at 0x0006 W/dalvikvm( 3522): VFY: unable to find class referenced in signature (Lcom/amazon/whisperlink/service/Device;) I/dalvikvm( 3522): Could not find method com.amazon.whisperlink.service.Device.getUuid, referenced from method com.amazon.whisperplay.fling.media.controller.impl.WhisperplayControllerAdaptor.deviceRemoved W/dalvikvm( 3522): VFY: unable to resolve virtual method 13936: Lcom/amazon/whisperlink/service/Device;.getUuid ()Ljava/lang/String; D/dalvikvm( 3522): VFY: replacing opcode 0x6e at 0x0006 W/dalvikvm( 3522): VFY: unable to find class referenced in signature (Lcom/amazon/whisperlink/service/Device;) E/dalvikvm( 3522): Could not find class 'com.amazon.whisperlink.util.SimpleFilter$ServiceIdDeviceFilter', referenced from method com.amazon.whisperplay.fling.media.controller.impl.WhisperplayControllerAdaptor.getConnection W/dalvikvm( 3522): VFY: unable to resolve new-instance 1953 (Lcom/amazon/whisperlink/util/SimpleFilter$ServiceIdDeviceFilter;) in Lcom/amazon/whisperplay/fling/media/controller/impl/WhisperplayControllerAdaptor; D/dalvikvm( 3522): VFY: replacing opcode 0x22 at 0x0000 W/dalvikvm( 3522): Unable to resolve superclass of Lcom/amazon/whisperplay/fling/media/controller/impl/ProxyStatusCallback; (1942) W/dalvikvm( 3522): Link of class 'Lcom/amazon/whisperplay/fling/media/controller/impl/ProxyStatusCallback;' failed E/dalvikvm( 3522): Could not find class 'com.amazon.whisperplay.fling.media.controller.impl.ProxyStatusCallback', referenced from method com.amazon.whisperplay.fling.media.controller.impl.WhisperplayControllerAdaptor.getHandler W/dalvikvm( 3522): VFY: unable to resolve const-class 1989 (Lcom/amazon/whisperplay/fling/media/controller/impl/ProxyStatusCallback;) in Lcom/amazon/whisperplay/fling/media/controller/impl/WhisperplayControllerAdaptor; D/dalvikvm( 3522): VFY: replacing opcode 0x1c at 0x0039 W/dalvikvm( 3522): VFY: unable to find class referenced in signature (Lcom/amazon/whisperlink/service/DeviceCallback;) W/dalvikvm( 3522): VFY: unable to find class referenced in signature (Lcom/amazon/whisperlink/service/DescriptionFilter;) I/dalvikvm( 3522): Could not find method com.amazon.whisperlink.service.Registrar$Iface.getKnownDevices, referenced from method com.amazon.whisperplay.fling.media.controller.impl.WhisperplayControllerAdaptor.getKnownDevicesExceptTCOMMOnlyTransports W/dalvikvm( 3522): VFY: unable to resolve interface method 13954: Lcom/amazon/whisperlink/service/Registrar$Iface;.getKnownDevices (Lcom/amazon/whisperlink/service/DescriptionFilter;)Ljava/util/List; D/dalvikvm( 3522): VFY: replacing opcode 0x72 at 0x0000 I/dalvikvm( 3522): Could not find method com.amazon.whisperlink.util.WhisperLinkUtil.getRegistrarConnection, referenced from method com.amazon.whisperplay.fling.media.controller.impl.WhisperplayControllerAdaptor.initRegistrarListener W/dalvikvm( 3522): VFY: unable to resolve static method 14336: Lcom/amazon/whisperlink/util/WhisperLinkUtil;.getRegistrarConnection ()Lcom/amazon/whisperlink/util/Connection; D/dalvikvm( 3522): VFY: replacing opcode 0x71 at 0x0003 W/dalvikvm( 3522): VFY: unable to resolve exception class 8349 (Lorg/apache/thrift/TException;) W/dalvikvm( 3522): VFY: unable to find exception handler at addr 0x6d W/dalvikvm( 3522): VFY: rejected Lcom/amazon/whisperplay/fling/media/controller/impl/WhisperplayControllerAdaptor;.initRegistrarListener ()V W/dalvikvm( 3522): VFY: rejecting opcode 0x0d at 0x006d W/dalvikvm( 3522): VFY: rejected Lcom/amazon/whisperplay/fling/media/controller/impl/WhisperplayControllerAdaptor;.initRegistrarListener ()V W/dalvikvm( 3522): Verifier rejected class Lcom/amazon/whisperplay/fling/media/controller/impl/WhisperplayControllerAdaptor; D/AndroidRuntime( 3522): Shutting down VM W/dalvikvm( 3522): threadid=1: thread exiting with uncaught exception (group=0x41ab5ba8) E/AndroidRuntime( 3522): FATAL EXCEPTION: main E/AndroidRuntime( 3522): Process: sa.android, PID: 3522 E/AndroidRuntime( 3522): java.lang.VerifyError: com/amazon/whisperplay/fling/media/controller/impl/WhisperplayControllerAdaptor E/AndroidRuntime( 3522): at com.amazon.whisperplay.fling.media.controller.DiscoveryController.start(DiscoveryController.java:71) I'm not an expert on Android runtimes. I just put the Fling jar file into my "libs" like all the others in my project, all of which seem to still be working. Not sure where to go to troubelshoot this sort of thing.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sermonaudiodev avatar image
sermonaudiodev answered
The answer is that there's a second JAR file WhisperPlay.jar that has to be included in the "libs" folder. I did not realize this. Anyhow, I'll leave this in case anyone gets this same inscrutable error. Nowhere on the Internet is this error described that I could find.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.