I am facing an error whenever I add implementation 'com.google.firebase:firebase-translate:22.0.0' in my Gradle module android project

huangapple go评论71阅读模式
英文:

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'
}
}

huangapple
  • 本文由 发表于 2023年5月29日 16:50:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76355885.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定