我想尝试用于Android开发的Intellij平台,但即使在新鲜之后,它也显示Gradle失败。请帮助。
我试过调整线路
implementation 'com.android.support:appcompat-v7:29.+'
一些其他版本,但没有效果。
这是我的模块级Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:29.+'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
这是我的项目级别 Gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Intellij构建gradles时我得到的错误是
ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@release/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+.
Show Details
Affected Modules: app
ERROR: Failed to resolve: com.android.support:appcompat-v7:29.0.1
Affected Modules: app
通过访问以下网站迁移到< code>androidX:
Refactor->Migrate to androidX
尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。 生成失败
我在Android studio中遇到了这个问题。 这是我的格雷德代码:
Android项目,在下面的链接上 https://gitlab.com/vandy-aad-2/aad-2-assg-1/
我最近把我的mindSdkVersion改为17,targetSdkVersion改为21,并且犯了很多错误。我修复了其中一些,但我无法修复这个: 我在Mac上使用Android Studio,我有Android支持库。 我的build.gradle文件: