【发布时间】:2019-06-22 10:21:15
【问题描述】:
我将一个由 unity 生成的项目导入到 android studio。
我在build.gradle 有问题。
我也安装了 Android Support Repository,但问题就是这样。 Sync阶段的这三个错误
"ERROR: Unable to resolve dependency for ':@debug/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: AR
ERROR: Unable to resolve dependency for ':@debugAndroidTest/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: AR
ERROR: Unable to resolve dependency for ':@debugUnitTest/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: AR"
Error at build output
Could not find any version that matches com.android.support:appcompat-v7:29.+.
Versions that do not match:
- 28.0.0
- 28.0.0-rc02
- 28.0.0-rc01
- 28.0.0-beta01
- 28.0.0-alpha3
- + 50 more
Required by:
project :
Please install the Android Support Repository from the Android SDK Manager.
Open Android SDK Manager
build.gradle的代码。
-->>>>
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
android {
compileSdkVersion 29
buildToolsVersion '29.0.0'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dependencies
{
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation(name: 'UnityChannel', ext: 'aar')
implementation(name: 'VuforiaWrapper', ext: 'aar')
implementation 'com.android.support:appcompat-v7:29.+'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}
defaultConfig {
minSdkVersion 16
targetSdkVersion 29
applicationId 'com.hj.ar'
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
versionCode 1
versionName '1.0'
}
【问题讨论】:
-
只需将您的项目从 appcompat 迁移到 androidx。这是链接,youtube.com/watch?v=0FZ_eUIsLTgmedium.com/google-developer-experts/…
标签: android gradle build.gradle android-appcompat