私はこれを解決するために多くのことを試みました。私は、コマンドラインでのGradleを使用してから私のAndroidアプリを構築しようとしています、私は次のエラーGradle error:メソッドを見つけられませんでした。android()
A problem occurred evaluating root project 'android-build'.
> Could not find method android() for arguments [[email protected]] on root project 'android-build'.
誰かがplsは私が間違っているものを指摘することができますを取得していますか? Androidのdeveloper guideで指定されているように
apply plugin: 'com.android.application'
:後
は、あなたがあなたのモジュールのbuild.gradleファイルの最初の行で、この設定を追加する必要が私のbuild.gradle
buildscript {
repositories {
maven {
url "http://repo1.maven.org/maven2"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
android {
compileSdkVersion 23
buildToolsVersion "21.1.2"
def versionPropsFile = file('version.properties')
if (versionPropsFile.canRead()) {
def Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
def code = versionProps['VERSION_CODE'].toInteger() + 1
versionProps['VERSION_CODE']=code.toString()
versionProps.store(versionPropsFile.newWriter(), null)
defaultConfig {
versionCode code
versionName "1.1"
minSdkVersion 14
targetSdkVersion 18
}
}
else {
throw new GradleException("Could not read version.properties!")
}
}
こんにちは、以下のリンクを試してください。多分動作します。 http://stackoverflow.com/questions/37250493/could-not-find-method-android-for-arguments http://stackoverflow.com/questions/26243480/could-not-find-method-android-for-arguments -when-building-android-project- – Jay