Android同步时出错,android - Android Studio 1.1.0 Gradle项目同步失败在OSX上导入Gradle项目时出错 - 堆栈内存溢出...

在尝试导入新项目时,用户遇到了Android Studio中Gradle项目同步失败的问题,错误提示为找不到名为“default”的配置。用户已经设置了GRAILS_HOME环境变量,并提供了build.gradle、settings.gradle和gradle-wrapper.properties等配置文件内容。尽管如此,问题仍然存在,可能的原因是Gradle版本不匹配或者项目配置错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我刚在这个文件夹中安装了gradle:/Users/joanet/Development/gradle-2.3

编辑launchd.conf文件

sudo vim /etc/launchd.conf

设置变量GRAILS_HOME

setenv GRAILS_HOME /Users/joanet/Development/gradle-2.3

使用文件 - >导入项目

但我收到此错误: Gradle项目同步失败 , 错误:在Android Studio中找不到名称为“default”的配置

60ebd688414b29affb9f5f2df6e31c1c.png

这里是build.gradle文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {

jcenter()

}

dependencies {

classpath 'com.android.tools.build:gradle:1.1.0'

// NOTE: Do not place your application dependencies here; they belong

// in the individual module build.gradle files

}

}

allprojects {

repositories {

jcenter()

}

}

和/app/build.gradle:

apply plugin: 'com.android.application'

android {

compileSdkVersion 22

buildToolsVersion '22.0.0'

defaultConfig {

applicationId "no.nordicsemi.android.nrftoolbox"

minSdkVersion 18

targetSdkVersion 22

versionCode 30

versionName "1.12.1"

}

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}

}

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

compile 'com.android.support:appcompat-v7:22.0.0'

compile project(':..:DFULibrary:dfu')

compile files('libs/achartengine-1.1.0.jar')

compile files('libs/nrf-logger-v2.0.jar')

}

这里是settings.gradle:

include ':app', '..:DFULibrary:dfu'

这里是gradle-wrapper.properties:

#Wed Apr 10 15:27:10 PDT 2013

distributionBase=GRADLE_USER_HOME

distributionPath=wrapper/dists

zipStoreBase=GRADLE_USER_HOME

zipStorePath=wrapper/dists

distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {

jcenter()

}

dependencies {

classpath 'com.android.tools.build:gradle:1.1.0'

// NOTE: Do not place your application dependencies here; they belong

// in the individual module build.gradle files

}

}

allprojects {

repositories {

jcenter()

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值