Reputation: 1
while generating signed apk from android studio getting error.
Cannot find a version of 'junit:junit' that satisfies the version constraints: Dependency path 'helloworld:app:unspecified' --> 'com.googlecode.json-simple:json-simple:1.1.1' --> 'junit:junit:4.10' Constraint path 'helloworld:app:unspecified' --> 'junit:junit:{strictly 4.10}' because of the following reason: debugRuntimeClasspath uses version 4.10 Dependency path 'helloworld:app:unspecified' --> 'com.android.support.test.espresso:espresso-core:2.2.2' --> 'com.android.support.test:runner:0.5' --> 'junit:junit:4.12'
Here is my buld.gradle file
> apply plugin: 'com.android.application'
>
> ext.android_support_version = '26.1.0' ext.arch_version = '1.0.0'
> ext.retrofit_version = '2.3.0'
>
> android {
> compileSdkVersion 26
> defaultConfig {
> applicationId "com.example.helloworlddeveloper"
> minSdkVersion 16
> targetSdkVersion 26
> versionCode 5
> versionName "2.0"
> testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
> vectorDrawables.useSupportLibrary = true
> multiDexEnabled true
> }
> buildTypes {
> release {
> minifyEnabled false
> proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
> }
> }
>
> }
>
> dependencies {
> implementation fileTree(dir: 'libs', include: ['*.jar'])
> androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2',
> {
> exclude group: 'com.android.support', module: 'support-annotations'
> })
> implementation "com.android.support:appcompat-v7:$android_support_version"
> implementation('com.mikepenz:materialdrawer:5.9.2@aar') {
> transitive = true
> }
> implementation('com.googlecode.json-simple:json-simple:1.1.1') {
> exclude group: 'org.hamcrest', module: 'hamcrest-core'
> }
> implementation "com.android.support:appcompat-v7:$android_support_version"
> implementation "com.android.support:design:$android_support_version"
> implementation "com.android.support:recyclerview-v7:$android_support_version"
> implementation "com.android.support:cardview-v7:$android_support_version"
> implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
> implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
> implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
> implementation 'com.github.bumptech.glide:glide:3.8.0'
> implementation "com.android.support:support-v4:$android_support_version"
> implementation "com.android.support:support-vector-drawable:$android_support_version"
> testImplementation 'junit:junit:4.12'
> implementation 'com.android.support:multidex:1.0.3'
> implementation 'com.google.android.gms:play-services-ads:17.1.2'
> implementation 'com.google.firebase:firebase-messaging:17.3.4'
> implementation 'com.github.judemanutd:autostarter:1.0.3'
>
> } apply plugin: 'com.google.gms.google-services'
Upvotes: 0
Views: 141
Reputation: 2060
Try to add implementation 'com.android.support:support-annotations:26.0.0'
and remove this exclude group: 'com.android.support', module: 'support-annotations'
Upvotes: 0