gpt4 book ai didi

android - 如何将Firebase和Snap Creative Kit作为Gradle依赖项包括在内

转载 作者:行者123 更新时间:2023-12-03 05:08:43 28 4
gpt4 key购买 nike

我试图在已经使用Firebase的android项目中使用Snap Creative Kit,但由于此错误而无法构建:

Program type already present: com.google.protobuf.Any$1

Firebase Firestore使用 protobuf-lite,而Snap Creative Kit使用 protobuf-java。我试图从Firestore中排除 protobuf-lite,但错误仍然存​​在。当我还从Firestore中排除 com.google.firebase:protolite-well-known-types时,该项目会构建但崩溃。

build.gradle(项目)
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.0.1'
classpath 'io.fabric.tools:gradle:1.25.4'
}
}

allprojects {
repositories {
google()
jcenter()
maven {
url "https://storage.googleapis.com/snap-kit-build/maven"
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

build.gradle(Module:app)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.snapchat.kit.sdk:creative:1.0.2'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.1.0'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'
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'
}

最佳答案

问题已解决,Creative Kit的最新版本解决了此问题。只是改变

 implementation 'com.snapchat.kit.sdk:creative:1.0.2'


 implementation 'com.snapchat.kit.sdk:creative:1.1.3'

关于android - 如何将Firebase和Snap Creative Kit作为Gradle依赖项包括在内,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52181528/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com