无法解决:Android Studio中的support-v4

时间:2018-07-02 08:36:08

标签: android support-v4

我更新到android studio 3.1.3后收到此错误

Failed to resolve: support-v4

尝试在android studio中构建项目后。

这是我的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'
}

如何查看实际情况?我在stackoverflow和google上都找不到它。

如您所见,我尝试在implementation 'com.android.support:support-v4:+'中添加dependencies仍然无效。

如何解决? 我应该看一下项目的任何部分吗?

1 个答案:

答案 0 :(得分:-1)

删除caches文件夹内的~/.gradle文件夹并再次同步。它对我有用。