Java android更新后梯度同步错误(未指定CompileSDK版本)
我有一个项目。它在更新程序版本3.2.1之前工作得很好。当我尝试同步gradle项目时,我遇到了一些错误,但我可以修复它。但我有一个问题,找不到办法。 这是我的身材,格雷德尔Java android更新后梯度同步错误(未指定CompileSDK版本),java,android,android-studio,androidx,Java,Android,Android Studio,Androidx,我有一个项目。它在更新程序版本3.2.1之前工作得很好。当我尝试同步gradle项目时,我遇到了一些错误,但我可以修复它。但我有一个问题,找不到办法。 这是我的身材,格雷德尔 apply plugin: 'com.android.application' android { compileSdkVersion 28 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion '28.0.3'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 15
targetSdkVersion 28
multiDexEnabled true
versionCode 7x
versionName "1.0.7x"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation files('libs/json_simple-1.1.jar')
implementation('com.omertron:themoviedbapi:4.2') {
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude module: 'junit'
}
implementation 'com.android.support:multidex:1.0.3'
implementation files('libs/okhttp-3.8.1.jar')
implementation files('libs/okio-1.13.0.jar')
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
//noinspection UseOfBundledGooglePlayServices
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:7.3.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.baoyz.swipemenulistview:library:1.3.0'
implementation 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
implementation 'javax.mail:mail:1.5.0-b01'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.github.orangegangsters:swipy:1.2.3@aar'
implementation 'io.michaelrocks:libphonenumber-android:8.9.0'
implementation 'com.github.joielechong:countrycodepicker:2.1.5'
testImplementation 'junit:junit:4.12'
implementation files('libs/xxx.jar')
}
apply plugin: 'com.google.gms.google-services'
以及:
嗯,我发现:
但是,这不再有帮助了。有人能帮我吗
targetSdkVersion
更改为28,并将所有编译
更改为实现
build.gradle
配置了正确的google()
repo。例如
repositories {
google() // be the first one.
jcenter()
}
我的相关答案如下:见鬼。我忘了。但是,在我改变之后。这仍然是错误的。有什么理想?可以用你更新的
build.gradle
和app/build.gradle
更新你的问题吗?嗯,不能。。。或者移动这个maven{url“https://maven.google.com“}
要成为这两个地方的第一个repositories为什么你有应用插件:'com.android.application'
内置所有项目{}
?我想这是我们要寻找的重点。当我评论这行的时候。重建工作很好很高兴听到你终于让它工作了。嗯,非常感谢你,当你花太多时间帮助我的时候,哈哈
repositories {
google() // be the first one.
jcenter()
}