Failed to resolve: support-v4 in android studio
Failed to resolve: support-v4 in android studio
I got this error after I update to android studio 3.1.3
Failed to resolve: support-v4
after try to build project in android studio.
Here is my build/gradle
build/gradle
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.8.1'
}
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'http://clinker.47deg.com/nexus/content/groups/public' }
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "app.udrinkidive.feed2us.com.customerbeta"
minSdkVersion 15
targetSdkVersion 22
versionCode 20
versionName "THONGLOR-RC19-20180509-C"
multiDexEnabled true
manifestPlaceholders = [
onesignal_app_id: '13976026-a6ff-42e2-8f58-744a1692aa42',
onesignal_google_project_number: '665136907244'
]
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
}
}
}
dependencies {
implementation 'com.android.support:support-v4:+'
implementation 'com.onesignal:OneSignal:[3.6.0, 3.99.99]'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:multidex:1.0.0'
implementation 'com.google.code.gson:gson:2.7'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.7.5'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'de.hdodenhof:circleimageview:2.0.0'
implementation 'com.jakewharton:butterknife:8.2.1'
implementation 'com.jakewharton:butterknife-compiler:8.2.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.1.0@aar') {
transitive = true;
}
implementation 'com.github.elevenetc:badgeview:v1.0.0'
implementation 'com.cocosw:bottomsheet:1.+@aar'
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support:percent:26.0.0'
implementation 'com.wdullaer:materialdatetimepicker:2.4.0'
implementation 'io.branch.sdk.android:library:2.+'
implementation 'com.google.android.gms:play-services-gcm:11.6.0'
implementation 'com.google.android.gms:play-services-location:11.6.0'
implementation 'com.google.android.gms:play-services-maps:11.6.0'
implementation 'com.google.android.gms:play-services-places:11.6.0'
implementation 'com.facebook.android:facebook-android-sdk:4.10.0'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1@aar'
implementation 'com.android.support:design:26.0.0'
implementation 'com.android.support:cardview-v7:26.0.0'
implementation 'com.android.support:recyclerview-v7:26.0.0'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'com.google.firebase:firebase-core:10.0.1'
}
How to check out what's really going on? I can't find it neither on stackoverflow nor google.
As you can see I tried to add implementation 'com.android.support:support-v4:+' in dependencies still doesn't work.
implementation 'com.android.support:support-v4:+'
dependencies
How to solve it?
Any part in the project I should take a look?
implementation 'com.android.support:support-v4:26.0.0'
Never use wildcards in your dependencies. It's unpredictable what version it'll use. Your app might break one day and you won't know why. Check this page for the latest version developer.android.com/topic/libraries/support-library/packages
– ZUNJAE
Jul 2 at 8:38
@NileshRathod same error sir
– Sarin Suriyakoon
Jul 2 at 8:52
@ZUNJAE I am not sure what you mean. What is "wildcards"?
– Sarin Suriyakoon
Jul 2 at 8:53
@SarinSuriyakoon try this
repositories { google() jcenter() }– Nilesh Rathod
Jul 2 at 8:53
repositories { google() jcenter() }
1 Answer
1
Delete caches folder inside ~/.gradle folder and sync again. It worked for me.
caches
~/.gradle
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
test case
implementation 'com.android.support:support-v4:26.0.0'– Nilesh Rathod
Jul 2 at 8:38