【发布时间】:2018-07-02 08:36:07
【问题描述】:
更新到 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 上都找不到它。
如您所见,我尝试在dependencies 中添加implementation 'com.android.support:support-v4:+' 仍然无效。
如何解决? 我应该看一下项目中的任何部分吗?
【问题讨论】:
-
测试用例
implementation 'com.android.support:support-v4:26.0.0' -
永远不要在依赖项中使用通配符。无法预测它将使用什么版本。您的应用程序可能有一天会崩溃,而您将不知道为什么。检查此页面以获取最新版本developer.android.com/topic/libraries/support-library/packages
-
@NileshRathod 同样的错误先生
-
@ZUNJAE 我不确定你的意思。什么是“通配符”?
-
@SarinSuriyakoon 我在几天前工作正常的 gradle 也遇到了类似的问题。你做了什么?我也面临同样的情况。我已经删除了 .gradle 文件夹,但仍然失败
标签: android support-v4