我在https://github.com/ParkSangGwon/TedPicker
的应用程序中添加了tedpicker但现在几周我尝试将gradle与互联网同步时出现此错误
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not resolve com.commonsware.cwac:camera:0.6.+.
Required by: YourApp:app:unspecified > com.github.ParkSangGwon:TedPicker:v1.0.10
> Could not resolve com.commonsware.cwac:camera:0.6.+.
> Failed to list versions for com.commonsware.cwac:camera.
> Unable to load Maven meta-data from https://repo.commonsware.com.s3.amazonaws.com/com/commonsware/cwac/camera/maven-metadata.xml.
> Could not GET https://repo.commonsware.com.s3.amazonaws.com/com/commonsware/cwac/camera/maven-metadata.xml'.
> Host name 'repo.commonsware.com.s3.amazonaws.com' does not match the certificate subject provided by the peer (CN=*.s3.amazonaws.com, O=Amazon.com Inc., L=Seattle, ST=Washington, C=US)
但如果我在gradle中切换到离线模式
,它可以正常工作这也是我的应用程序的buid.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
}
} apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.hugo'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "org.urapp.urapp"
minSdkVersion 19
targetSdkVersion 22
versionCode 2
multiDexEnabled true
versionName "1.1"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ASL2.0'}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
maxProcessCount 4
javaMaxHeapSize "4g"
}
}
repositories {
mavenCentral()
jcenter()
maven {
url "https://repo.commonsware.com.s3.amazonaws.com"
}
maven { url "https://jitpack.io" }
}
android {
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile project(':flexjson-2.1')
compile('org.apache.httpcomponents:httpmime:4.2.6') {
exclude module: 'httpclient'
}
compile project(':Android-AdvancedWebView')
compile project(':flexjson-2.1')
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.6.0'
compile 'com.google.android.gms:play-services-identity:9.6.0'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'org.apache.httpcomponents:httpclient:4.3.5'
compile 'com.android.support:design:24.2.1'
compile 'net.opacapp:multiline-collapsingtoolbar:1.2.2'
compile 'com.android.support:palette-v7:24.2.1'
compile 'com.github.ParkSangGwon:TedPicker:v1.0.10'
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.google.guava:guava:18.0'
compile 'com.github.oliveiradev:image-zoom:0.3.0'
compile 'com.android.support:percent:24.2.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.volley:volley:1.0.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
compile 'com.google.firebase:firebase-crash:9.4.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.picasso:picasso:2.5.2'
}
afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = ['--multi-dex']
} else {
dx.additionalParameters += '--multi-dex'
}
}
}
subprojects {
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = false
} else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = false
}
}
}
apply plugin: 'com.google.gms.google-services'
答案 0 :(得分:12)
我在我的应用程序中添加了tedpicker
我不建议使用该库,因为它依赖于已停产的库(即我的CWAC-Camera库)。
但现在几周我尝试将gradle与互联网同步时出现此错误
将url "https://repo.commonsware.com.s3.amazonaws.com"
更改为url "https://s3.amazonaws.com/repo.commonsware.com"
。