gpt4 book ai didi

java - 错误:(59, 8)错误: cannot access ActivityCompatApi23 class file for android. support.v4.app.ActivityCompatApi23 找不到

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:44:32 30 4
gpt4 key购买 nike

这是我的build.gradle

apply plugin: 'com.android.application'


android {
compileSdkVersion 25
buildToolsVersion "26.0.2"
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}

defaultConfig {
applicationId "com.example.user2.trafficmap"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true

}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

repositories {
mavenCentral()
maven { url "https://maven.google.com" }
}



dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'io.nlopez.smartlocation:library:3.3.3'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.google.android.gms:play-services-location:11.8.0'
compile 'com.google.android.gms:play-services-base:11.8.0'
compile 'com.google.android.gms:play-services-maps:11.8.0'
compile 'com.github.arimorty:floatingsearchview:2.1.1'
compile 'com.google.android.gms:play-services-places:11.4.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:26.0.0'
}

当我运行我的项目时,我看到了这个错误

Error:(59, 8) error: cannot access ActivityCompatApi23 class file for android.support.v4.app.ActivityCompatApi23 not found

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

我该如何解决这个问题??? :(

最佳答案

我通过在 build.gradle 中添加这段代码解决了这个问题

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.3.0'
}
}
}
}

关于java - 错误:(59, 8)错误: cannot access ActivityCompatApi23 class file for android. support.v4.app.ActivityCompatApi23 找不到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48072953/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com