简体   繁体   English

来自gradle(AndroidStudio)的奇怪消息。

[英]strange message from gradle (AndroidStudio).

From one second to the other I got the following error with Gradle in AndroidStudio and I have no clue what to do with it. 从一秒钟到另一秒钟,我在AndroidStudio中遇到了Gradle的以下错误,我不知道该如何处理。

Error when trying to start my app: 尝试启动我的应用程序时出错:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_map_testApkCopy'.
   > Could not find com.android.support:appcompat-v7:27.0.1.
     Required by:
         project :app
         project :app > com.android.support:design:25.0.0
   > Could not find com.android.support:support-v4:27.0.1.
     Required by:
         project :app > com.android.support:design:25.0.0
         project :app > com.android.support:design:25.0.0 > com.android.support:transition:25.0.0
   > Could not find com.android.support:support-annotations:27.0.1.
     Required by:
         project :app > com.android.support:design:25.0.0 > com.android.support:recyclerview-v7:25.0.0
         project :app > com.android.support:design:25.0.0 > com.android.support:recyclerview-v7:25.0.0 > com.android.support:support-compat:25.0.0
   > Could not find com.android.support:support-annotations:27.0.1.
     Required by:
         project :app > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-core:4.29.0
   > Could not find com.android.support:support-core-utils:27.0.1.
     Required by:
         project :app > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-core:4.29.0
   > Could not find com.android.support:appcompat-v7:27.0.1.
     Required by:
         project :app > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.0
   > Could not find com.android.support:cardview-v7:27.0.1.
     Required by:
         project :app > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.0
   > Could not find com.android.support:customtabs:27.0.1.
     Required by:
         project :app > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.0
   > Could not find com.android.support:support-v4:27.0.1.
     Required by:
         project :app > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.0

build.gradle : (Mobile: app) (Did not changed since month. Compared with repo and no change) build.gradle :(移动设备:应用程序)(自一个月以来未更改。与回购相比,未更改)

apply plugin: 'com.android.application'

android {
    signingConfigs {
        sapps {
            keyAlias 'keyalias'
            keyPassword 'xxxxxx'
            storeFile file('C:/eclipse/keystore/mykeystore')
            storePassword 'xxxxxx'
        }
    }
    compileSdkVersion 25
    buildToolsVersion "25.0.3"

    defaultConfig {
        applicationId "appid"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 179
        versionName "2.54"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        resValue "string", "appID", "wgd"
        manifestPlaceholders = [iconpath: "@drawable/icon", versionCode:"161", versionName:"2.37"]

    }
    buildTypes {
        demo {
            buildConfigField "String", "appID", "\"WGD\""
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.sapps
            resValue "string", "app_name", "Chronica"
            manifestPlaceholders = [iconpath: "@drawable/icon", facebookid:"@string/facebook_app_id_demo"]
            applicationIdSuffix '.chronicbrowser'
        }
        demo_test {
            buildConfigField "String", "appID", "\"WGD_TEST\""
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.sapps
            debuggable true

            resValue "string", "app_name", "Chronica Test"
            manifestPlaceholders = [iconpath: "@drawable/icon", facebookid:"@string/facebook_app_id_demo"]
            applicationIdSuffix '.chronicbrowser_wgd_test'
        }
        timeline {

            buildConfigField "String", "appID", "\"WG\""
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.sapps
            resValue "string", "app_name", "WorldHistory"
            applicationIdSuffix '.chronicbrowser_wg_en'
            manifestPlaceholders = [iconpath: "@drawable/icon_timeline", facebookid:"@string/facebook_app_id_timeline"]
        }
        timeline_test {
            buildConfigField "String", "appID", "\"WG_TEST\""
            minifyEnabled false
            debuggable true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            resValue "string", "app_name", "WorldHistory Test"
            applicationIdSuffix '.chronicbrowser_wg_en'
            manifestPlaceholders = [iconpath: "@drawable/icon_timeline_test", facebookid:"@string/facebook_app_id_timeline"]
            signingConfig signingConfigs.sapps
        }
        map {
            buildConfigField "String", "appID", "\"WG_MAPS\""
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            resValue "string", "app_name", "WorldHistory Atlas"
            applicationIdSuffix '.chronicbrowser_maps_en'
            manifestPlaceholders = [iconpath: "@drawable/icon_maps", facebookid:"@string/facebook_app_id_maps"]
            signingConfig signingConfigs.sapps
        }
        map_test {
            buildConfigField "String", "appID", "\"WG_MAPS_TEST\""
            //resValue "string", "RES_appID", "wgd"
            debuggable true
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            resValue "string", "app_name", "WorldHistory Atlas Test"
            applicationIdSuffix '.chronicbrowser_maps_en'
            manifestPlaceholders = [iconpath: "@drawable/icon_maps_test", facebookid:"@string/facebook_app_id_maps"]
            signingConfig signingConfigs.sapps

        }
        worldwarII {
            buildConfigField "String", "appID", "\"WW2\""
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            resValue "string", "app_name", "WorldWar II"
            applicationIdSuffix '.chronicbrowser_ww2_en'
            manifestPlaceholders = [iconpath: "@drawable/icon_ww2", facebookid:"@string/facebook_app_id_ww2"]
            signingConfig signingConfigs.sapps

        }
        worldwarII_test {
            buildConfigField "String", "appID", "\"WW2_TEST\""
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            resValue "string", "app_name", "WorldWar II Test"
            applicationIdSuffix '.chronicbrowser_ww2_en_test'
            manifestPlaceholders = [iconpath: "@drawable/icon_ww2", facebookid:"@string/facebook_app_id_ww2"]
            signingConfig signingConfigs.sapps
        }
    }
    compileOptions.encoding = 'ISO-8859-1'
    productFlavors {
    }
}

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.0.0'
    compile 'com.android.support:design:25.0.0'
    testCompile 'junit:junit:4.12'
    compile files('libs/lvl.jar')
    compile files('libs/google-play-services.jar')
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile files('libs/GoogleConversionTrackingSdk-2.2.4.jar')
}


repositories {
    mavenCentral()
}

Can someone help me ? 有人能帮我吗 ?

It is probably due of compile 'com.facebook.android:facebook-android-sdk:[4,5)' . 这可能是由于compile 'com.facebook.android:facebook-android-sdk:[4,5)' Change it with 更改它

compile('com.facebook.android:facebook-android-sdk:[4,5)') { 
         exclude group: 'com.android.support'
}

it is the only one that has an open version. 它是唯一具有开放版本的软件。

You are using a lower version of the support library than the one required by the other components. 您使用的支持库版本低于其他组件所需的版本。 try 尝试

  compile 'com.android.support:appcompat-v7:27.0.1'
  compile 'com.android.support:design:27.0.1'

The most recent versions of the Android libraries are available from Google's Maven repository. 可从Google的Maven存储库中获取最新版本的Android库。

To include Google's Maven repository: 要包含Google的Maven存储库:

in your top-level build.gradle file: 顶层 build.gradle文件中:

allprojects {
    repositories {
        google()

        // If you're using a version of Gradle lower than 4.1, you must instead use:
        // maven {
        //     url 'https://maven.google.com'
        // }
        // An alternative URL is 'https://dl.google.com/dl/android/maven2/'
    }
}

Details: https://developer.android.com/studio/build/dependencies.html#google-maven 详细信息: https : //developer.android.com/studio/build/dependencies.html#google-maven

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM