gpt4 book ai didi

Android Studio 启动时 Gradle 错误

转载 作者:行者123 更新时间:2023-12-02 05:29:34 29 4
gpt4 key购买 nike

每次启动 Android Studio 时都会出现以下错误:

Gradle 'VertretungsplanProject' project refresh failed: Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'. A problem occurred configuring project ':Vertretungsplan'. A problem occurred configuring project ':Vertretungsplan'. Failed to notify project evaluation listener. A problem occurred configuring project ':libraries:actionbarsherlock'. Failed to notify project evaluation listener. Could not normalize path for file 'P:\Projekte\VertretungsplanProject\libraries\actionbarsherlock:Vertretungsplan\libs\android-support-v4.jar'. The syntax for the filename, directoryname or the volume label is wrong

我的项目如下所示:

enter image description here

等级设置:

enter image description here

的build.gradle:Vertretungsplan:

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

dependencies {
compile files('libs/commons-io-2.4.jar')
compile project(':libraries:actionbarsherlock')
}

android {
compileSdkVersion 17
buildToolsVersion "17.0.0"

defaultConfig {
minSdkVersion 8
targetSdkVersion 16
}
}

:VertretungsplanProject的build.gradle为空。

build.gradle :actionbarsherlock:

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android-library'

dependencies {
compile files(':Vertretungsplan/libs/android-support-v4.jar')
}

android {
compileSdkVersion 17
buildToolsVersion "17.0.0"

defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}

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

当我现在想编译时,出现此错误:

Deprecated make implementation
Old implementation of "Make" feature is enabled for this project. It has been deprecated and will be removed soon. Please enable newer 'external build' feature in Settings | Compiler.

将此设置更改为使用外部构建后,一切正常。但每次我启动 Android Studio 时都会出现这个问题,这真的很烦人。

更新

我从 libs 文件夹中删除了 android-support-v4.jar 并简单地编写了 compile 'com.android.support:support-v4:18.0 .0' 到 ActionbarSherlock 的 build.gradle。然后使用已安装的 SDK 中的 android-support-v4.jar

最佳答案

编辑

  1. 转到文件 > 设置 >“构建、执行、部署”> 编译器

直接点击编译。

  • 选中选项:使用外部构建 > 应用 > 确定
  • 这对我有用! :)

    关于Android Studio 启动时 Gradle 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17907893/

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