americosfacebook / googletv-issues

Automatically exported from code.google.com/p/googletv-issues
0 stars 0 forks source link

Outdated protobuf version in Anymote Library #75

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In our app we are using the actual version of protocol buffers (2.4.1).  Adding 
the Anymote Library to integrate some second screen functionality i get a build 
error, resulting from the duplicate protobuf lib in my buildpath.

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: 
Lcom/google/protobuf/GeneratedMessageLite$ExtendableMessage$ExtensionWriter;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
    at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
    at com.android.dx.command.dexer.Main.processClass(Main.java:486)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
    at com.android.dx.command.dexer.Main.access$400(Main.java:67)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    at com.android.dx.command.dexer.Main.processOne(Main.java:418)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
    at com.android.dx.command.dexer.Main.run(Main.java:206)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:180)
    at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:703)
    at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:577)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
    at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
    at org.eclipse.core.internal.resources.Project.build(Project.java:124)
    at com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:1000)
    at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:147)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:937)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1141)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[2012-08-29 04:08:31 - TVGuide] Dx 1 error; aborting
[2012-08-29 04:08:31 - TVGuide] Conversion to Dalvik format failed with error 1

When i replace the existing protobuf jar (2.2.0) in the Anymote Libray with the 
actual one (2.4.1) i get a NoClassDefFoundError, when i try to pair with gtv:

08-28 19:47:40.967: E/AndroidRuntime(32461): java.lang.NoClassDefFoundError: 
com.google.polo.wire.protobuf.PoloProto$PairingRequest
08-28 19:47:40.967: E/AndroidRuntime(32461):    at 
com.google.polo.wire.protobuf.ProtobufWireAdapter.toProto(ProtobufWireAdapter.ja
va:299)
08-28 19:47:40.967: E/AndroidRuntime(32461):    at 
com.google.polo.wire.protobuf.ProtobufWireAdapter.poloMessageToProto(ProtobufWir
eAdapter.java:277)
08-28 19:47:40.967: E/AndroidRuntime(32461):    at 
com.google.polo.wire.protobuf.ProtobufWireAdapter.sendMessage(ProtobufWireAdapte
r.java:245)
08-28 19:47:40.967: E/AndroidRuntime(32461):    at 
com.google.polo.pairing.PairingSession.sendMessage(PairingSession.java:675)
08-28 19:47:40.967: E/AndroidRuntime(32461):    at 
com.google.polo.pairing.ClientPairingSession.doInitializationPhase(ClientPairing
Session.java:63)
08-28 19:47:40.967: E/AndroidRuntime(32461):    at 
com.google.polo.pairing.PairingSession.doPair(PairingSession.java:390)
08-28 19:47:40.967: E/AndroidRuntime(32461):    at 
com.example.google.tv.anymotelibrary.connection.ConnectingTask.attemptToPair(Con
nectingTask.java:262)
08-28 19:47:40.967: E/AndroidRuntime(32461):    at 
com.example.google.tv.anymotelibrary.connection.ConnectingTask.connect(Connectin
gTask.java:196)
08-28 19:47:40.967: E/AndroidRuntime(32461):    at 
com.example.google.tv.anymotelibrary.connection.ConnectingTask.run(ConnectingTas
k.java:172)

So it would be nice when the Anymote Library (or rather the integrated Pairing 
Protocol?) could be updated to use the actual protobuf version.

*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by mtthsfrd...@gmail.com on 29 Aug 2012 at 2:26

GoogleCodeExporter commented 8 years ago

Original comment by mjo...@google.com on 4 Sep 2012 at 6:41

GoogleCodeExporter commented 8 years ago
We succeeded in making anymote use protobuf 2.4.1. Here are the steps I did:
* Create new anymote.jar: switch to new protobuf jar, re-compile .proto
* Create new polo.jar: switch to new protobuf jar, re-compile .proto, adjust 
ProtobufWireAdapter.java to use GeneratedMessageLite not GeneratedMessage
* AnymoteSender.java: remove unused onDataList method and unused imports

Seems to work.

Original comment by mar...@greenrobot.de on 6 Sep 2012 at 5:13

Attachments: