Подтвердить что ты не робот

Android gradle проблема синхронизации

Это приложение работает отлично, без каких-либо проблем. Внезапно я увидел эту проблему с синхронизацией gradle. Я действительно застрял и нуждаюсь в помощи. Что делать сейчас? Я удалил и переустановил репозиторий поддержки Android от менеджера SDK.

C:\Users\DELL\AndroidStudioProjects\Prokriti\app\build.gradle
    Error:Error:Failed to resolve: com.android.support:support-annotations:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:customtabs:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:cardview-v7:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:support-v4:27.0.1
Install Repository and sync project
    Error:Error:Failed to resolve: com.android.support:support-core-utils:27.0.1
Install Repository and sync project

build.gradle(приложение)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.avtro.prokriti.prokriti"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })


    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-core-utils:25.3.1'
    compile 'com.android.support:support-annotations:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.android.gms:play-services-auth:11.0.4'
    compile 'com.google.firebase:firebase-core:11.0.2'
    compile 'com.google.firebase:firebase-messaging:11.0.2'
    compile 'com.google.firebase:firebase-database:11.0.2'
    compile 'com.google.firebase:firebase-auth:11.0.2'
    compile 'com.google.firebase:firebase-ads:11.0.2'
    compile 'com.afollestad.material-dialogs:core:0.9.4.5'
    compile 'com.wang.avi:library:2.1.3'
    compile 'com.google.android.gms:play-services-ads:11.0.4'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.survivingwithandroid:weatherlib:1.6.0'
    compile 'com.amitshekhar.android:android-networking:1.0.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.squareup.okhttp:okhttp:2.0.0'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.google.firebase:firebase-storage:11.0.2'
    androidTestCompile 'junit:junit:4.12'
    compile 'javax.inject:javax.inject:1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.github.bumptech.glide:glide:3.8.0'
}
apply plugin: 'com.google.gms.google-services'

build.gradle(проект)

buildscript {
    repositories {
        jcenter()
    }
dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

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

Я не обновлял студию Android или gradle. Установлен репозиторий поддержки Android.

4b9b3361

Ответ 1

Я решаю проблему, удаляя

 compile 'com.facebook.android:facebook-android-sdk:[4,5)'

И добавив

compile 'com.facebook.android:facebook-android-sdk:4.26.0'

Ответ 2

Вам нужно изменить только одну строку.

Исправлено обновлением версии facebook sdk

от
компилировать 'com.facebook.android:facebook-android-sdk:[4,5)' до

компилировать 'com.facebook.android:facebook-android-sdk:4.26.0'

Ответ 3

введите описание изображения здесь

'com.facebook.android:facebook-android-sdk: [4,5)' или

'com.facebook.android:facebook-android-sdk:4. +

выше замените ниже

'com.facebook.android:facebook-android-sdk:4.26.0'

Ответ 4

Добавьте google() в buildscript.repositories и allprojects.repositories:

buildscript {
    repositories {
        google()
        jcenter()
    }
dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

Это должно решить вашу проблему.

Ответ 5

Its work for me
Its work for me
Update Android SDK Build -Tools and SDK platforms
Changed in project build file.
buildscript {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}
changed in app build file
compileSdkVersion 26
buildToolsVersion "26.0.2"
Disable dependencies inspection.
compile 'com.android.support:design:25.3.1

Ответ 6

используйте этот

repositories {
        maven { url 'https://maven.google.com/' }
    }

Ответ 7

Для проектов с реагированием: добавьте maven repo в свой проект. (Удаляет ошибку response-native-fbsdk после добавления ссылок maven repo).

buildscript {
    repositories {
       jcenter()
       mavenCentral()
       maven {            // Add this block
          url "https://maven.google.com"
       }
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }

        // If something is not found from above maven repo.
        maven { url 'https://maven.google.com' }    // Add this block 
    }
}

Подробнее здесь

Ответ 8

Не

compile 'com.facebook.android:facebook-android-sdk:[4,5)'

Согласно Facebook SDK for Android, вы должны использовать

 // Facebook Android SDK (everything)
  compile 'com.facebook.android:facebook-android-sdk:4.+'

для обновленного случая читайте Changelog and release notes for the Facebook SDK for Android.

compile 'com.facebook.android:facebook-android-sdk:4.26.0'
compile 'com.facebook.android:facebook-android-sdk:4.27.0'
compile 'com.facebook.android:facebook-android-sdk:4.28.0'
compile 'com.facebook.android:facebook-android-sdk:4.29.0'

Ответ 9

Заменить

compile 'com.facebook.android:facebook-android-sdk:[4,5)'

по

compile 'com.facebook.android:facebook-android-sdk:4.26.0'

надеюсь, что это сработает