API YouTube - тип программы уже представлен: com.google.api.services.youtube.YouTube $ Builder - PullRequest
0 голосов
/ 08 ноября 2018

Я следую этому руководству, чтобы создать приложение Youtube: https://code.tutsplus.com/tutorials/create-a-youtube-client-on-android--cms-22858

Но когда я его построил, у меня появляется ошибка:

Тип программы уже присутствует: com.google.api.services.youtube.YouTube $ Деятельность $ Вставить Сообщение {kind = ERROR, text = Тип программы уже присутствует: com.google.api.services.youtube.YouTube $ Деятельность $ Вставка, sources = [Неизвестный исходный файл], имя инструмента = Optional.of (D8)}

И logcat работает без остановок.

1 Ответ

0 голосов
/ 08 ноября 2018

build.gradle:

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation files('libs/gson-2.1.jar')
implementation files('libs/jsr305-1.3.9.jar')
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation('com.google.api-client:google-api-client-android:1.23.0') {
    exclude group: 'org.apache.httpcomponents'
}
implementation('com.google.apis:google-api-services-youtube:v3-rev192-1.23.0') {
    exclude group: 'org.apache.httpcomponents'
}
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

}

...