6

Androidプラグインに関連するクラスパスが見つからないというエラーが表示されます。gradle 1.2 を使用しています。

エラーは次のとおりです。

Could not find method classpath() for arguments [org.gradle.api.plugins:gradle-android-plugin:1.2.1]

ここに私のbuild.gradleファイルがあります

//setup external dependency plugins we will use to build a android application
buildscript {
    repositories {
        mavenCentral()
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }
    }

    dependencies {
        classpath 'org.gradle.api.plugins:gradle-android-plugin:1.2.1'
    }
}

//apply eclipse plugin
apply plugin: 'eclipse'

//apply android plugin
apply plugin: 'android'

apply plugin: 'maven'

task hello << {
    String value = 'wagwan'
    println 'Hello world!' + value.toUpperCase()
}

ありがとう

編集:私が今受け取った新しいエラー:

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve group:org.gradle.api.plugins, module:gradle-android-plugin, version:1.2.1.
  Required by:
      :RssUnified:unspecified
   > Could not GET 'http://repo1.maven.org/maven2/org/gradle/api/plugins/gradle-android-plugin/1.2.1/gradle-android-plugin-1.2.1.pom'.
   > Could not GET 'https://oss.sonatype.org/content/repositories/snapshots/org/gradle/api/plugins/gradle-android-plugin/1.2.1/gradle-android-plugin-1.2.1.pom'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
4

1 に答える 1

18

ガイドに示されているように、dependencies { classpath ... }ブロックは内側に入る必要がありbuildscript { ... }ます。ビルド スクリプトに対してのみ、という名前の構成classpathが定義されます。

于 2012-10-29T11:06:51.657 に答える