我是新来的Android,我的IDE是Android的工作室,在gradle这个同步窗口我看到2个错误:错误与Android Studio中创建应用程序
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:25.+ Install Repository and sync project
Show in File
Show in Project Structure dialogError:(23, 24) Failed to resolve: com.android.support.test.espresso:espresso-core:2.0 Install Repository and sync project
Show in File
Show in Project Structure dialog
我试图从SDK管理器,但不幸的是下载支持库我不能因为我们在伊朗而受到限制。
然后我手动下载了它,并把它添加到我的项目/库/ Android的支持-V7-appcompat.jar和我添加它的依赖线
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.android.aqil.textview"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
allprojects {
repositories {
//...
maven {
url "https://maven.google.com"
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile files('support/annotations/android-support-annotations.jar')
compile files('support/appcompat/libs/android-support-v4.jar')
compile files('support/appcompat/libs/android-support-v7-appcompat.jar')
compile files('support/customtabs/libs/android-support-customtabs.jar')
compile files('support/design/libs/android-support-design.jar')
compile files('support/multidex/library/libs/android-support-multidex.jar')
compile files('support/multidex/instrumentation/libs/android-support-multidex-instrumentation.jar')
compile files('support/percent/libs/android-support-percent.jar')
compile files('support/recommendation/libs/android-support-recommendation.jar')
compile files('support/v13/android-support-v13.jar')
compile files('support/v14/preference/libs/android-support-v14-preference.jar')
compile files('support/v17/leanback/libs/android-support-v17-leanback.jar')
compile files('support/v17/preference-leanback/libs/android-support-v17-preference-leanback.jar')
compile files('support/v4/android-support-v4.jar')
compile files('support/v7/appcompat/libs/android-support-v4.jar')
compile files('support/v7/appcompat/libs/android-support-v7-appcompat.jar')
compile files('support/v7/cardview/libs/android-support-v7-cardview.jar')
compile files('support/v7/gridlayout/libs/android-support-v7-gridlayout.jar')
compile files('support/v7/mediarouter/libs/android-support-v7-mediarouter.jar')
compile files('support/v7/palette/libs/android-support-v7-palette.jar')
compile files('support/v7/preference/libs/android-support-v7-preference.jar')
compile files('support/v7/recyclerview/libs/android-support-v7-recyclerview.jar')
}
到gradle.build但是,当我尝试建立我的项目,我得到这个错误
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not find any matches for com.android.support:appcompat-v7:25.+ as no versions of com.android.support:appcompat-v7 are available.
Required by:
TextView_Programming_API17:app:unspecified
我使用API 17,我试过19,20,25但错误是一样的。此外,我添加了支持库存储库,但没有工作,问题在哪里?
您可以从您的浏览器此链接? https://jcenter.bintray.com/com/android/support/support-compat/24.2.0/support-compat-24.2.0.aar –
@KamranAhmed我得到这个错误“未找到请求的路径。” –
更新了链接,现在可以吗? –