我是新來的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我得到這個錯誤「未找到請求的路徑。」 –
更新了鏈接,現在可以嗎? –