Невозможно разрешить зависимость для ': app @ debug / compileClasspath': невозможно преобразовать URL 'com.google.android.gms: play-services-maps: 17.0.0' в файл - PullRequest
0 голосов
/ 29 сентября 2019

Я создаю демонстрацию Google Maps из Android Coding на YouTube. Я создал приложение, но по какой-то причине получаю сообщение об ошибке

Невозможно преобразовать URL 'com.google.android.gms: play-services-maps: 17.0.0' в файл.

Вот мой build.gradle (Project Google Maps Demo):

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

    buildscript {
        repositories {
            google()
            jcenter()
            mavenLocal()

        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.5.0'
            classpath 'com.google.gms:google-services:4.0.1'


            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }

    allprojects {
        repositories {
            google()
            jcenter()
            maven { url 'https://maven.fabric.io/public' }
            maven {
                url "https://maven.google.com"
            }
        }
    }

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

Кто-нибудь может помочь? РЕДАКТИРОВАТЬ: Скопировал и вставил один и тот же код дважды, вот мой фактический build.gradle (модуль: приложение) **

Вот мой app/build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.zydavia.googlemapsdemo"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation files('com.google.android.gms:play-services-maps:17.0.0')
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.google.android.gms:play-services:12.0.1'
    implementation 'androidx.navigation:navigation-fragment:2.1.0'
    implementation 'androidx.navigation:navigation-runtime:2.1.0'
    implementation 'androidx.navigation:navigation-ui-ktx:2.1.0'
}

1 Ответ

0 голосов
/ 02 октября 2019

Удалить эту строку:

//implementation files('com.google.android.gms:play-services-maps:17.0.0')
...