1

build.gradle

  apply plugin: 'com.android.application'
 android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
    applicationId "com.example.speakplease"
    minSdkVersion 16
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

 dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation ('com.google.apis:google-api-services-translate:v2-rev47- 
1.22.0')
implementation 'com.google.cloud:google-cloud-translate:0.5.0'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.android.support:support-v13:28.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso- 
 core:3.0.2'
compileOnly 'com.google.dagger:dagger-parent:2.9'
//noinspection GradleDependency
annotationProcessor 'com.google.auto.value:auto-value:1.2'
}
apply plugin: 'com.google.gms.google-services'

I have imported google translation api and after that I started getting Annotation error. I am able resolve it but not getting this error. I am aware of it that some dependencies are clashing but unable to find out.

Here is the error.

   Program type already present: 
 com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream
  Message{kind=ERROR, text=Program type already present: 
 com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream, 
  sources=[Unknown source file], tool name=Optional.of(D8)}
aminography
  • 21,986
  • 13
  • 70
  • 74
  • 1
    Hello welcome to SO, it will help if you paste your error message here so that people will have a better context. – Nobi Oct 21 '18 at 11:26

1 Answers1

0

This is what happens when your 2 dependencies include the same dependency. Check out this question to find out how to see which dependency is causing the issue.

I have had the same problem, for me it was ExoPlayer, cause It was included in a 3rd party library I was using, and I included it by itself also.

I don't know for sure which 2 are in conflict for you, but these seem suspiciously "related":

implementation ('com.google.apis:google-api-services-translate:v2-rev47-1.22.0')
implementation 'com.google.cloud:google-cloud-translate:0.5.0'
Vucko
  • 7,371
  • 2
  • 27
  • 45