gpt4 book ai didi

android - Could not call incremental task 错误在Android Studio中

转载 作者:行者123 更新时间:2023-11-30 03:15:09 24 4
gpt4 key购买 nike

所以我整天都在 android studio 上纠结于此。

我已尝试按照本教程为我的应用程序添加对 google maps API 的支持

https://developers.google.com/maps/documentation/android/start#install_the_android_sdk

但是当我尝试构建应用程序时出现此错误

Gradle:任务“:dexDebug”执行失败。

Could not call IncrementalTask.taskAction() on task ':dexDebug'

这是我的build.gradel

  buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'


}
}
apply plugin: 'android'

dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services:4.0.30'
compile fileTree(dir: 'libs', include: '*.jar')
}

android {
compileSdkVersion 16
buildToolsVersion "18.1.1"

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')

// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}

当我删除删除此行以进行测试时,不会出现上述错误。

    compile 'com.google.android.gms:play-services:4.0.30'

有谁知道错误代码是什么?

最佳答案

您是否安装了 Play 服务?在 Android Studio 中,转到 SDK 管理器。在 Extras 下,确保您拥有最新版本的 Google Play 服务。安装后,您可能需要重新启动 Android Studio。

要仔细检查 4.0.30 是否已下载,您可以检查 Android Studio 的本地 Maven 存储库是否包含该文件夹。路径类似于:

/Applications/Android Studio.app/sdk/extras/google/m2repository/com/google/android/gms/4.0.30

关于android - Could not call incremental task 错误在Android Studio中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20264638/

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