【发布时间】:2018-12-20 07:29:20
【问题描述】:
关于这个有很多不同的问题,但是关于使用v7.28.0,v7.28.+,v7.28.0.0-rc02的问题但是当我同步我的项目时,我得到了这个错误:
无法解析 ':app@debug/compileClasspath' 的依赖关系:可以 无法解析 com.android.support:appcompat-v7:28.0.0。
我检查了Support library setup 并按照它的说明进行操作,但没有帮助。
这是我的模块应用程序
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.1'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.mobaleghan.nasimnoor"
manifestPlaceholders = [
onesignal_app_id: 'b1ced87b-48d1-4857-a68b-9c287aa4003f',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE'
]
minSdkVersion 16
targetSdkVersion 28
versionCode 8
versionName "1.6.3"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug {
debuggable true
}
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:preference-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.google.android.apps.dashclock:dashclock-api:2.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation "com.android.support:support-core-utils:28.0.0"
implementation 'com.onesignal:OneSignal:3.10.3'
}
和项目等级:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
我已经在设置中测试过,android studio 的互联网连接很好,但我不知道该去哪里找。
我什至在 AS 3.2.1 中创建了一个新项目,但我得到了同样的错误。 不知道为什么this happens every time I update AS!
【问题讨论】:
-
你试过用VPN编译吗?
-
@SiSa 我想我不知道你在说什么!
-
您是否尝试将
support:support-annotations更新为28.0.0? -
@AlexJolig 你知道对伊朗有一些制裁。一些谷歌功能也遵循这些制裁。因此,为了下载库并成功编译,您需要在 VPN/代理运行时进行编译
-
@SiSa 是的!那!是的,我正在使用 VPN
标签: android android-studio android-gradle-plugin