英文:
I am facing an error whenever I add implementation 'com.google.firebase:firebase-translate:22.0.0' in my Gradle module android project
问题
I am facing an error whenever I add implementation 'com.google.firebase:firebase-translate:22.0.0' in my Gradle module.
Error:
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
This my full gradle file:
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.isaacdarlong.myworshipresources"
minSdk 28
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'com.google.android.material:material:1.7.0'
implementation 'com.firebaseui:firebase-ui-database:8.0.2'
//implementation "androidx.recyclerview:recyclerview-selection:1.1.0"
implementation "androidx.recyclerview:recyclerview:1.2.1"
//implementation "androidx.recyclerview:recyclerview:1.3.1"
//implementation "androidx.recyclerview:recyclerview:1.3.0-beta02"
implementation "androidx.cardview:cardview:1.0.0"
implementation 'com.github.bumptech.glide:glide:4.14.2'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-database:20.1.0'
implementation 'com.google.firebase:firebase-auth:21.1.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'com.google.firebase:firebase-messaging:23.1.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
implementation 'com.google.android.material:material:1.2.0'
implementation 'com.squareup.picasso:picasso:2.8'
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:11.1.0'
implementation 'org.jsoup:jsoup:1.15.3'
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:31.2.0')
// Add the dependency for the Firebase Authentication library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-auth'
// Also add the dependency for the Google Play services library and specify its version
implementation 'com.google.android.gms:play-services-auth:20.4.1'
implementation 'com.google.android.gms:play-services-location:21.0.1'
///////////////////////////////////////////////////
//implementation 'com.google.firebase:firebase-translate:22.0.0'
implementation 'com.google.firebase:firebase-ml-natural-language:22.0.1'
implementation 'com.google.firebase:firebase-ml-natural-language-translate-model:20.0.9'
implementation 'com.google.firebase:firebase-translate:22.0.0'
/////////////////////////
implementation 'com.android.volley:volley:1.2.1'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
Hope this helps!
英文:
I am facing an error whenever I add implementation 'com.google.firebase:firebase-translate:22.0.0' in my Gradle module.
Error:
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
This my full gradle file:
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.isaacdarlong.myworshipresources"
minSdk 28
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'com.google.android.material:material:1.7.0'
implementation 'com.firebaseui:firebase-ui-database:8.0.2'
//implementation "androidx.recyclerview:recyclerview-selection:1.1.0"
implementation "androidx.recyclerview:recyclerview:1.2.1"
//implementation "androidx.recyclerview:recyclerview:1.3.1"
//implementation "androidx.recyclerview:recyclerview:1.3.0-beta02"
implementation "androidx.cardview:cardview:1.0.0"
implementation 'com.github.bumptech.glide:glide:4.14.2'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-database:20.1.0'
implementation 'com.google.firebase:firebase-auth:21.1.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'com.google.firebase:firebase-messaging:23.1.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
implementation 'com.google.android.material:material:1.2.0'
implementation 'com.squareup.picasso:picasso:2.8'
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:11.1.0'
implementation 'org.jsoup:jsoup:1.15.3'
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:31.2.0')
// Add the dependency for the Firebase Authentication library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-auth'
// Also add the dependency for the Google Play services library and specify its version
implementation 'com.google.android.gms:play-services-auth:20.4.1'
implementation 'com.google.android.gms:play-services-location:21.0.1'
///////////////////////////////////////////////////
//implementation 'com.google.firebase:firebase-translate:22.0.0'
implementation 'com.google.firebase:firebase-ml-natural-language:22.0.1'
implementation 'com.google.firebase:firebase-ml-natural-language-translate-model:20.0.9'
implementation 'com.google.firebase:firebase-translate:22.0.0'
/////////////////////////
implementation 'com.android.volley:volley:1.2.1'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
答案1
得分: 0
这解决了问题。
dependencies {
implementation 'com.google.cloud:google-cloud-translate:1.27.0'
// 禁用 CheckDuplicateStrings 任务。
implementation('com.google.cloud:google-cloud-translate:1.27.0') {
exclude group: 'com.google.cloud', module: 'google-cloud-core'
}
}
英文:
This has solved the issue.
dependencies {
implementation 'com.google.cloud:google-cloud-translate:1.27.0'
// Disable the CheckDuplicateStrings task.
implementation('com.google.cloud:google-cloud-translate:1.27.0') {
exclude group: 'com.google.cloud', module: 'google-cloud-core'
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论