googlevr / gvr-android-sdk

Google VR SDK for Android
http://developers.google.com/vr/android/
Other
3.28k stars 1.28k forks source link

Program type already present: com.google.protobuf.nano.CodedOutputByteBufferNano #563

Closed itmanzzz closed 6 years ago

itmanzzz commented 6 years ago

Please help!! I'm adding the gradle: implementation 'com.google.vr:sdk-base:1.140.0'

Its conflicting w project's dependences

Program type already present: com.google.protobuf.nano.CodedOutputByteBufferNano Message{kind=ERROR, text=Program type already present: com.google.protobuf.nano.CodedOutputByteBufferNano, sources=[Unknown source file], tool name=Optional.of(D8)}

sigmaxipi commented 6 years ago

What are the full set of dependencies in your application? This error happens when one of the GVR SDK libraries has the same Java class as another dependency. The builder complains that two dependencies have the class and it can't figure out which class to use.

In the short term, you could try editing the sdk-base.aar's classes.jar file and removing the problematic CodedOutputByteBufferNano.class file.

In the long term, we'll need to update our SDK build system to avoid having this extra class file.

OAkyildiz commented 6 years ago

Hello,

Do you have any updates in this? Or which version of the API doesn't cause that?

sigmaxipi commented 6 years ago

Without the full set of dependencies for the project, it's not possible to diagnose the issue. One of the dependencies has a copy of the com.google.protobuf.nano.CodedOutputByteBufferNano class. sdk-base depends on sdk-common which depends on com.google.protobuf.nano:protobuf-javanano.

I verified that this class isn't in any of the SDK's aars so it's baked into another dependency's aar.

OAkyildiz commented 6 years ago

I my case it is org.ros.android_core:android_15:0.2.0, I might fork it and update its deps. It is quite outdated. EDIT: Turns out switching to vr.sdk I did not remove the lib .jars incldued as dependencies for cardboard SDK