Android Studio 1.4.1을 사용하고 있습니다. 모든 프로젝트를 Android Studio에서 열면 프로젝트의 모든 클래스가 올바르게로드되고 프로젝트가 제대로 작동합니다. 내가 "EcoAssistant_03"라는 이름의 특정 프로젝트, 나는 다음과 같은 메시지가 나타납니다 OPN 할 때 문제는 : 내가 프로젝트 파크 잘못 모르는빌드 gradle로 인해 앱에서 오류가 발생합니다.
Error:(22, 0) Gradle DSL method not found: 'android()'
Possible causes:<ul><li>The project 'EcoAssistant_03' may be using a version of Gradle that does not contain the method.
<a href="openGradleSettings">Gradle settings</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>
을, 그리고 그것이 실행 얻을하는 방법을 모른다 바르게.
아래에 게시 된 build.gradle 파일을 한 번 봐, 그리고 나를이
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.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
}
dependencies {
}
build.gradle을 실행 얻는 방법을 알려 주시기 바랍니다 :
를apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.com.ecoassistant_03"
minSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile files('libs/Jama-1.0.3.jar')
compile files('libs/drivingEfficiencyModuleRunnable_00_out.jar')
}
업데이트 :
을 구축해야 s로 표시됩니다. 그 여분의 프로젝트 "myapplication"을 제거하는 방법, 나는 그것을 만들지 않았다 – user2121
그것은 건물에서 아무것도 막는가? 'settings.gradle'에 포함되어 있습니까? 아니요, 아무 것도하지 않으면 삭제할 수 있습니다. –
setting.gradle에 다음이 포함되어 있습니다. include ': app', ': myapplication', ': myapplication' – user2121