Ошибка: не удалось разрешить: время выполнения - PullRequest
0 голосов
/ 11 июня 2018

, так что мой проект работал нормально вчера, и я попытался открыть его сегодня, и это дает мне эту ошибку, помощь будет высоко ценится. Я долго пытался найти, что происходит не так, но кажется, что все ответы не работают со мной

Ошибка: не удалось разрешить: во время выполнения Открыть файл

вот файл build.gradle (Project):

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

buildscript {

    repositories {
        google()
        jcenter()

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


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

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
    }
}

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

, а вот профиль приложения сборки

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.android.writer"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.google.firebase:firebase-database:11.0.4'
    implementation 'com.google.firebase:firebase-auth:11.0.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.github.clans:fab:1.6.4'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.firebase:firebase-client-android:2.5.2+'
}


apply plugin: 'com.google.gms.google-services'

Ответы [ 4 ]

0 голосов
/ 17 августа 2018

Это сработало для меня

repositories {
    google()`Goolge repo`
    jcenter()
    maven {
        url 'https://maven.google.com/ `Google maven repo`
        name 'Google'
    }

}
0 голосов
/ 11 июня 2018
allprojects {
    repositories {
        google()
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
        jcenter()

    }
}

Вы должны поставить google() в качестве 1-й строки.Напоминание Первая строка.Я надеюсь, что это поможет вам.

0 голосов
/ 11 июня 2018

Это очень странно и заняло у меня почти 4-5 часов, чтобы исправить.Но, оказывается, вам нужно поместить google() вверху и jcenter() внизу репозиториев в файлах сборки для всех модулей.Maven может пойти между ними, и это будет исправлено.

0 голосов
/ 11 июня 2018

На основе ответа в Android Studio 3.1.2: Не удалось разрешить: время выполнения , попробуйте изменить порядок импорта в файле проекта build.gradle на

allprojects {
    repositories {
        google()
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
        jcenter()

    }
}

Это сработалодля меня.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...