简体   繁体   English

Gradle Issue Android Studio

[英]Gradle Issue Android Studio

I am having issues with gradle in my android application. 我在Android应用程序中遇到了gradle问题。

android {
 compileSdkVersion 27
 defaultConfig {
    applicationId "za.co.gtsolutions.vivachoc"
    minSdkVersion 15
    targetSdkVersion 27
    versionCode 2
    versionName "1.5"
    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.constraint:constraint-layout:1.1.0'
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.github.bumptech.glide:glide:4.6.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.android.support:design:27.1.1'
 implementation 'com.android.support:appcompat-v7:27.1.1'
 implementation 'com.stripe:stripe-android:6.1.2'
 implementation 'com.google.code.gson:gson:2.8.2'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
 implementation 'testfairy:testfairy-android-sdk:1.+@aar'
 testImplementation "org.robolectric:robolectric:3.8"
 implementation 'com.facebook.android:facebook-login:4.32.0'
 android {
    testOptions {
        unitTests {
            includeAndroidResources = true
        }
    }
  }
   compile 'com.android.support:cardview-v7:27.1.1'
   compile 'com.android.support.test.espresso:espresso-contrib:3.0.1'

} I get the following error: all com.android.support libraries should use the same version and my application will not run because of this. 我收到以下错误:所有com.android.support库都应使用相同版本,因此我的应用程序将无法运行。 I have changed the minimumSDK Version and targetVersion to apply to the project that i am working on. 我更改了minimumSDK版本和targetVersion,以应用于我正在处理的项目。 在此处输入图片说明 I am totaly lost on what the issue could be ? 我完全不知道可能是什么问题?

use 27.0.2 instead of 27.1.1 like below 使用27.0.2而不是27.1.1如下所示

implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:cardview-v7:27.0.2'

The answer after sometime is guided by the following answer: All com.android.support libraries must use the exact same version specification was the following: 有时,答案取决于以下答案: 所有com.android.support库必须使用与以下内容完全相同的版本规范

implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation "com.android.support:customtabs:27.1.1"

The application needs to use the customtabs library which was missing 应用程序需要使用缺少的customtabs库

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

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